UNPKG

2.32 kBMarkdownView Raw
1[<img src="https://rawgit.com/RdBird/rdbird.io/master/RDBIRD_logo.svg" alt="RdBird Project" height="40" />][rdbird-url]
2
3# ESLint Configuration
4
5[![Version][version-svg]][package-url]
6[![Build Status][circleci-svg]][circleci-url]
7[![License][license-image]][license-url]
8
9This package provides RdBird's [ESLint](http://eslint.org) configuration as an extensible shared config.
10
11<!-- START doctoc generated TOC please keep comment here to allow auto update -->
12<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
13
14
15- [How to use it in your project](#how-to-use-it-in-your-project)
16 - [1. Install dependency](#1-install-dependency)
17 - [2. Update `.eslintrc.json`](#2-update-eslintrcjson)
18 - [3. Update `package.json`](#3-update-packagejson)
19- [Architecture](#architecture)
20
21<!-- END doctoc generated TOC please keep comment here to allow auto update -->
22
23## How to use it in your project
24
25### Setup requirements
26```sh
27npm install \
28eslint babel-eslint prettier \
29@rdbird/eslint-config \
30--save-dev
31```
32
33### Configure eslint
34
35#### Use all plugins
36***.eslintrc.json***
37```json
38{
39 "extends": [
40 "@rdbird/eslint-config"
41 ]
42}
43```
44
45*OR*
46
47#### Cherry-pick plugins
48***.eslintrc.json***
49```json
50{
51 "extends": [
52 "@rdbird/eslint-config/base",
53 "@rdbird/eslint-config/react",
54 "@rdbird/eslint-config/jsx-a11y",
55 "@rdbird/eslint-config/flowtype"
56 ]
57}
58```
59
60### Setup the lint task
61
62***package.json***
63```json
64{
65 "scripts": {
66 "lint": "eslint .",
67 "format": "eslint . --fix"
68 }
69}
70```
71
72## Architecture
73
74For a better community alignment, the configuration extends [StandardJS](https://standardjs.com/). Inspiration also comes from:
75* [AirBnB](https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb-base)
76* [Algolia](https://github.com/algolia/eslint-config-algolia)
77* [Supermind](https://github.com/supermind/eslint-config-supermind)
78
79[rdbird-url]: //rdbird.io
80[version-svg]: https://img.shields.io/npm/v/@rdbird/eslint-config.svg?style=flat-square
81[package-url]: https://www.npmjs.com/package/@rdbird/eslint-config
82[circleci-svg]: https://circleci.com/gh/RdBird/eslint-config.svg?style=shield
83[circleci-url]: https://circleci.com/gh/RdBird/eslint-config
84[license-image]: http://img.shields.io/badge/license-MIT-green.svg?style=flat-square
85[license-url]: LICENSE