|
1 | 1 | {
|
2 |
| - "parser": "@babel/eslint-parser", // Specifies the ESLint parser |
| 2 | + "parser": "@babel/eslint-parser", |
| 3 | + "plugins": [ |
| 4 | + "react", |
| 5 | + "react-hooks", |
| 6 | + "inclusive-language", |
| 7 | + "jest", |
| 8 | + "import", |
| 9 | + "fp" |
| 10 | + ], |
3 | 11 | "extends": [
|
4 | 12 | "eslint:recommended",
|
5 | 13 | "plugin:react/recommended",
|
6 |
| - "plugin:prettier/recommended" |
| 14 | + "plugin:prettier/recommended", |
| 15 | + "plugin:jest/recommended" |
7 | 16 | ],
|
8 | 17 | "settings": {
|
9 | 18 | "react": {
|
|
15 | 24 | "node": true,
|
16 | 25 | "es6": true
|
17 | 26 | },
|
18 |
| - "plugins": ["react", "react-hooks", "inclusive-language"], |
19 | 27 | "parserOptions": {
|
20 | 28 | "requireConfigFile": false,
|
21 | 29 | "babelOptions": {
|
22 | 30 | "presets": [
|
23 | 31 | "@babel/preset-env",
|
24 |
| - "@babel/preset-react" |
| 32 | + "@babel/preset-react", |
| 33 | + "@babel/preset-typescript" |
25 | 34 | ]
|
26 | 35 | },
|
27 | 36 | "ecmaFeatures": {
|
|
31 | 40 | "sourceType": "module" // Allows for the use of imports
|
32 | 41 | },
|
33 | 42 | "rules": {
|
34 |
| - "prettier/prettier": ["error", {"semi": true, "singleQuote": true, "jsxSingleQuote": true, "parser": "flow"}], |
35 |
| - "inclusive-language/use-inclusive-words": "error", |
| 43 | + "prettier/prettier": [ |
| 44 | + 2, |
| 45 | + { |
| 46 | + "semi": true, |
| 47 | + "singleQuote": true, |
| 48 | + "jsxSingleQuote": true, |
| 49 | + "parser": "flow" |
| 50 | + } |
| 51 | + ], |
| 52 | + "inclusive-language/use-inclusive-words": 2, |
36 | 53 | "semi": [2, "always"],
|
37 | 54 | "jsx-quotes": [2, "prefer-single"],
|
38 | 55 | "no-console": 2,
|
|
41 | 58 | "no-dupe-else-if": 0,
|
42 | 59 | "no-setter-return": 0,
|
43 | 60 | "prefer-promise-reject-errors": 0,
|
| 61 | + "import/order": 2, |
44 | 62 | "react/button-has-type": 2,
|
45 | 63 | "react/default-props-match-prop-types": 2,
|
46 | 64 | "react/jsx-closing-bracket-location": 2,
|
47 | 65 | "react/jsx-closing-tag-location": 2,
|
48 | 66 | "react/jsx-curly-spacing": 2,
|
49 | 67 | "react/jsx-curly-newline": 2,
|
50 | 68 | "react/jsx-equals-spacing": 2,
|
51 |
| - "react/jsx-max-props-per-line": [2, { "maximum": 1, "when": "multiline"}], |
| 69 | + "react/jsx-max-props-per-line": [2, { "maximum": 1, "when": "multiline" }], |
52 | 70 | "react/jsx-first-prop-new-line": 2,
|
53 |
| - "react/jsx-curly-brace-presence": [2, { "props": "never", "children": "never" }], |
| 71 | + "react/jsx-curly-brace-presence": [ |
| 72 | + 2, |
| 73 | + { "props": "never", "children": "never" } |
| 74 | + ], |
54 | 75 | "react/jsx-pascal-case": 2,
|
55 | 76 | "react/jsx-props-no-multi-spaces": 2,
|
56 | 77 | "react/jsx-tag-spacing": [2, { "beforeClosing": "never" }],
|
|
64 | 85 | "react/sort-comp": 2,
|
65 | 86 | "react/style-prop-object": 2,
|
66 | 87 | "react/void-dom-elements-no-children": 2,
|
67 |
| - "react-hooks/rules-of-hooks": "error", // Checks rules of Hooks |
68 |
| - "react-hooks/exhaustive-deps": "warn" // Checks effect dependencies |
69 |
| - } |
| 88 | + "react/function-component-definition": [ |
| 89 | + 2, |
| 90 | + { "namedComponents": ["function-declaration", "arrow-function"] } |
| 91 | + ], |
| 92 | + "react-hooks/rules-of-hooks": 2, // Checks rules of Hooks |
| 93 | + "react-hooks/exhaustive-deps": 1, // Checks effect dependencies |
| 94 | + "fp/no-mutating-methods": 1 |
| 95 | + }, |
| 96 | + "overrides": [ |
| 97 | + { |
| 98 | + "files": ["**/*.ts", "**/*.tsx"], |
| 99 | + "plugins": ["@typescript-eslint"], |
| 100 | + "rules": { |
| 101 | + "prettier/prettier": 0, |
| 102 | + "@typescript-eslint/no-unused-vars": 2, |
| 103 | + "@typescript-eslint/no-non-null-assertion": 0 |
| 104 | + }, |
| 105 | + // Weird behavior with no-unused-vars |
| 106 | + // See https://stackoverflow.com/a/58513127 |
| 107 | + "extends": [ |
| 108 | + "eslint:recommended", |
| 109 | + "plugin:@typescript-eslint/strict", |
| 110 | + "plugin:@typescript-eslint/recommended" |
| 111 | + ], |
| 112 | + "parser": "@typescript-eslint/parser", |
| 113 | + "parserOptions": { |
| 114 | + "project": ["./tsconfig.json"] |
| 115 | + } |
| 116 | + } |
| 117 | + ] |
70 | 118 | }
|
0 commit comments