1 | # eslint-config [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url]
|
2 |
|
3 | #### An ESLint [Shareable Config][shareable-configs-url]
|
4 |
|
5 | ## Installation
|
6 |
|
7 | ```sh
|
8 | npm install @3fs/eslint-config [eslint@7.17.0]
|
9 | # OR
|
10 | yarn add @3fs/eslint-config [eslint@7.17.0]
|
11 | ```
|
12 |
|
13 | ## Usage
|
14 |
|
15 | Shareable configs are designed to work with the `extends` feature of `.eslintrc` files.
|
16 | You can learn more about
|
17 | [Shareable Configs][shareable-configs-url] on the
|
18 | official ESLint website.
|
19 |
|
20 | To use this shareable config, first run this:
|
21 |
|
22 | ```sh
|
23 | npm install --save-dev eslint@7.17.0 @3fs/eslint-config
|
24 | # OR
|
25 | yarn add --dev eslint@7.17.0 @3fs/eslint-config
|
26 | ```
|
27 |
|
28 | Then, add this to your .eslintrc(.js|.json|.yml) file:
|
29 |
|
30 | ```json
|
31 | {
|
32 | "extends": "@3fs"
|
33 | }
|
34 | ```
|
35 |
|
36 | *Note: We omitted the `/eslint-config` sufix since it is automatically assumed by ESLint. Only works for esnext since its specified as default*
|
37 |
|
38 | You can override settings from the shareable config by adding them directly into your
|
39 | `.eslintrc` file.
|
40 |
|
41 | ### All available configs
|
42 |
|
43 | * `@3fs` or `@3fs/eslint-config/configs/esnext` - ES6+ config; Requires [babel-eslint@10.1.0][babel-eslint]
|
44 | * `@3fs/eslint-config/configs/es5` - ES5 config
|
45 | * `@3fs/eslint-config/configs/node` - ES6+ NodeJS config; Requires [babel-eslint@10.1.0][babel-eslint]
|
46 | * `@3fs/eslint-config/configs/node-es5` - ES5 NodeJS config
|
47 | * `@3fs/eslint-config/configs/ng` - AngularJS config; Requires [eslint-plugin-angular@4.0.1][eslint-plugin-angular]
|
48 | * `@3fs/eslint-config/configs/react` - React config; Requires [babel-eslint@10.1.0][babel-eslint], [eslint-plugin-react@7.22.0][eslint-plugin-react], [eslint-plugin-jsx-a11y@6.4.1][eslint-plugin-jsx-a11y], [eslint-plugin-react-hooks@4.2.0][eslint-plugin-react-hooks]
|
49 | * `@3fs/eslint-config/configs/react-native` - React Native config; Requires [babel-eslint@10.1.0][babel-eslint], [eslint-plugin-react@7.22.0][eslint-plugin-react], [eslint-plugin-jsx-a11y@6.4.1][eslint-plugin-jsx-a11y] and [eslint-plugin-react-native@3.10.0][eslint-plugin-react-native]
|
50 | * `@3fs/eslint-config/configs/ts` - TypeScript config; Requires [typescript@4.1.3][typescript], [@typescript-eslint/eslint-plugin@4.12.0][@typescript-eslint/eslint-plugin], [@typescript-eslint/parser@4.12.0][@typescript-eslint/parser]
|
51 |
|
52 |
|
53 |
|
54 | [//]: # (URLs)
|
55 |
|
56 | [//]: # (main)
|
57 |
|
58 | [npm-image]: https://img.shields.io/npm/v/@3fs/eslint-config.svg
|
59 | [npm-url]: https://npmjs.org/package/@3fs/eslint-config
|
60 | [downloads-image]: https://img.shields.io/npm/dm/@3fs/eslint-config.svg
|
61 | [downloads-url]: https://npmjs.org/package/@3fs/eslint-config
|
62 | [shareable-configs-url]: http://eslint.org/docs/developer-guide/shareable-configs
|
63 |
|
64 | [//]: # (other)
|
65 |
|
66 | [babel-eslint]: https://www.npmjs.com/package/babel-eslint
|
67 | [eslint-plugin-angular]: https://www.npmjs.com/package/eslint-plugin-angular
|
68 | [eslint-plugin-react]: https://www.npmjs.com/package/eslint-plugin-react
|
69 | [eslint-plugin-jsx-a11y]: https://www.npmjs.com/package/eslint-plugin-jsx-a11y
|
70 | [eslint-plugin-react-hooks]: https://www.npmjs.com/package/eslint-plugin-react-hooks
|
71 | [typescript]: https://www.npmjs.com/package/typescript
|
72 | [@typescript-eslint/parser]: https://www.npmjs.com/package/@typescript-eslint/parser
|
73 | [@typescript-eslint/eslint-plugin]: https://www.npmjs.com/package/@typescript-eslint/eslint-plugin
|
74 | [eslint-plugin-react-native]: https://www.npmjs.com/package/eslint-plugin-react-native
|
75 |
|