1 | # eslint-config-fbjs
|
2 |
|
3 | For the most part, this configuration matches the ESLint configuration we have internally at Facebook.
|
4 |
|
5 | There are several exceptions:
|
6 |
|
7 | - **No special cases for projects.** Some projects have stricter lint rules. Those configurations are not present here. If you open source a project with different configuration, just specify the overrides in your own repository's `.eslintrc`
|
8 | - **No fb-specific rules.** We have a number of custom rules internally that are not synced out. We may do that in the future. This means there are several things which we will not catch here but will be caught in Phabricator. Beware of that when relying on this configuration as your only linting process.
|
9 |
|
10 | ## Usage
|
11 |
|
12 | ### Install:
|
13 |
|
14 | #### `npm`
|
15 | ```sh
|
16 | npm install --save-dev \
|
17 | eslint-config-fbjs \
|
18 | eslint-plugin-babel \
|
19 | eslint-plugin-flowtype \
|
20 | eslint-plugin-jsx-a11y \
|
21 | eslint-plugin-react \
|
22 | eslint-plugin-relay \
|
23 | eslint \
|
24 | babel-eslint
|
25 | ```
|
26 |
|
27 | #### `yarn`
|
28 | ```sh
|
29 | yarn add --dev
|
30 | eslint-config-fbjs \
|
31 | eslint-plugin-babel \
|
32 | eslint-plugin-flowtype \
|
33 | eslint-plugin-jsx-a11y \
|
34 | eslint-plugin-react \
|
35 | eslint-plugin-relay \
|
36 | eslint \
|
37 | babel-eslint
|
38 | ```
|
39 |
|
40 | ### Configure
|
41 |
|
42 | Add `extends: 'fbjs'` to your local `.eslintrc`
|
43 |
|
44 | #### Strict Configuration
|
45 |
|
46 | This package also comes with a *strict* version of the config. This can be used to make all warnings be reported as errors. While this can be overly strict, it can be helpful to avoid the case where some CI configurations don't fail for warnings.
|
47 |
|
48 | Use `extends: fbjs/strict` in your `.eslintrc`
|