|
| 1 | +# eslint-config-gitduck-react |
| 2 | + |
| 3 | +#### An [ESLint shareable config](https://eslint.org/docs/developer-guide/shareable-configs) for TypeScript that is based on [eslint-config-standard-with-typescript](https://github.com/standard/eslint-config-standard-with-typescript) and has GidDuck specific rules for React apps. |
| 4 | + |
| 5 | +[](http://standardjs.com) |
| 6 | + |
| 7 | +## Usage |
| 8 | + |
| 9 | +Shareable configs are designed to work with the `extends` feature of `.eslintrc` files. |
| 10 | +You can learn more about |
| 11 | +[Shareable Configs](http://eslint.org/docs/developer-guide/shareable-configs) on the |
| 12 | +official ESLint website. |
| 13 | + |
| 14 | +Run the following command: |
| 15 | + |
| 16 | +```shell |
| 17 | +npm install --save-dev \ |
| 18 | + eslint@7 \ |
| 19 | + eslint-config-standard@14 \ |
| 20 | + eslint-plugin-standard@4 \ |
| 21 | + eslint-plugin-promise@4 \ |
| 22 | + eslint-plugin-import@2 \ |
| 23 | + eslint-plugin-node@11 \ |
| 24 | + eslint-plugin-react@7 \ |
| 25 | + typescript@3 \ |
| 26 | + @typescript-eslint/eslint-plugin@3 \ |
| 27 | + @typescript-eslint/parser@3 \ |
| 28 | + eslint-config-standard-with-typescript@18 \ |
| 29 | + github:gitduckhq/eslint-config-gitduck \ |
| 30 | + github:gitduckhq/eslint-config-gitduck-react |
| 31 | +``` |
| 32 | + |
| 33 | +Here is an example `.eslintrc.js`: |
| 34 | + |
| 35 | +```javascript |
| 36 | +module.exports = { |
| 37 | + extends: 'gitduck-react', |
| 38 | + parser: '@typescript-eslint/parser', |
| 39 | + parserOptions: { |
| 40 | + project: './tsconfig.json', |
| 41 | + }, |
| 42 | + plugins: [ |
| 43 | + '@typescript-eslint', |
| 44 | + 'react', |
| 45 | + ], |
| 46 | +} |
| 47 | +``` |
| 48 | + |
| 49 | +*Note: The `eslint-config-` prefix in `extends` is omitted since it is automatically assumed by ESLint.* |
| 50 | + |
| 51 | +You can override settings from the shareable config by adding them directly into this file. |
0 commit comments