diff options
Diffstat (limited to '.eslintrc')
-rw-r--r-- | .eslintrc | 170 |
1 files changed, 116 insertions, 54 deletions
@@ -3,71 +3,133 @@ | |||
3 | "parser": "@babel/eslint-parser", | 3 | "parser": "@babel/eslint-parser", |
4 | "extends": "eslint-config-airbnb", | 4 | "extends": "eslint-config-airbnb", |
5 | "plugins": ["jest"], | 5 | "plugins": ["jest"], |
6 | "rules": { | 6 | "overrides": [ |
7 | "arrow-parens": 0, | 7 | { |
8 | "consistent-return": 0, | 8 | "files": ["**/*.ts", "**/*.tsx"], |
9 | "no-param-reassign": 0, | 9 | "env": { "browser": true, "es6": true, "node": true }, |
10 | "import/extensions": 0, | 10 | "extends": ["airbnb-typescript"], |
11 | "import/no-extraneous-dependencies": 0, | 11 | "parser": "@typescript-eslint/parser", |
12 | "import/no-unresolved": [ | 12 | "parserOptions": { |
13 | 2, | 13 | "ecmaFeatures": { "jsx": true }, |
14 | { | 14 | "ecmaVersion": 2018, |
15 | "ignore": ["electron"] | 15 | "sourceType": "module", |
16 | } | 16 | "project": "./tsconfig.json" |
17 | ], | 17 | }, |
18 | "import/prefer-default-export": 0, | 18 | "plugins": ["@typescript-eslint"], |
19 | "linebreak-style": 0, | 19 | "rules": { |
20 | "react/static-property-placement": 0, | 20 | // eslint |
21 | "react/state-in-constructor": 0, | 21 | "arrow-parens": 0, |
22 | "react/jsx-props-no-spreading": 0, | 22 | "array-callback-return": 1, |
23 | "react/prefer-stateless-function": 0, | 23 | "class-methods-use-this": 0, |
24 | "react/jsx-filename-extension": [ | 24 | "consistent-return": 0, |
25 | 1, | 25 | "implicit-arrow-linebreak": 0, |
26 | { | 26 | "linebreak-style": 0, |
27 | "extensions": [".js", ".jsx"] | 27 | "max-len": 0, |
28 | } | 28 | "no-confusing-arrow": 0, |
29 | ], | 29 | "no-console": 0, |
30 | "react/forbid-prop-types": 0, | 30 | "no-param-reassign": 0, |
31 | "react/destructuring-assignment": 0, | 31 | "no-return-assign": 1, |
32 | "prefer-destructuring": 1, | 32 | "no-underscore-dangle": 0, |
33 | "no-underscore-dangle": 0, | 33 | "no-use-before-define": 0, |
34 | "max-len": 0, | 34 | "prefer-destructuring": 1, |
35 | "class-methods-use-this": 0, | 35 | "object-curly-newline": 0, |
36 | "no-console": 0, | 36 | "operator-linebreak": 0, |
37 | "react/jsx-no-bind": 0, | 37 | // @typescript-eslint |
38 | "react/sort-comp": 0, | 38 | "@typescript-eslint/indent": 0, |
39 | "jsx-a11y/no-static-element-interactions": 0, | 39 | "@typescript-eslint/no-shadow": 0, |
40 | "react/jsx-no-target-blank": 0, | 40 | "@typescript-eslint/no-unused-expressions": 0, |
41 | "no-restricted-syntax": [0, "ForInStatement"], | 41 | // eslint-plugin-import |
42 | "jsx-a11y/no-noninteractive-element-interactions": 1, | 42 | "import/extensions": 0, |
43 | "jsx-a11y/label-has-for": [ | 43 | "import/no-cycle": 1, |
44 | 2, | 44 | "import/no-extraneous-dependencies": 0, |
45 | { | 45 | "import/no-unresolved": 0, |
46 | "components": ["Label"], | 46 | "import/prefer-default-export": 0, |
47 | "required": { | 47 | // eslint-plugin-react |
48 | "every": ["id"] | 48 | "react/destructuring-assignment": 0, |
49 | }, | 49 | "react/button-has-type": 0, |
50 | "allowChildren": false | 50 | "react/forbid-prop-types": 0, |
51 | "react/jsx-curly-newline": 0, | ||
52 | "react/jsx-no-bind": 0, | ||
53 | "react/jsx-no-target-blank": 0, | ||
54 | "react/jsx-props-no-spreading": 0, | ||
55 | "react/no-deprecated": 1, | ||
56 | "react/no-array-index-key": 0, | ||
57 | "react/prefer-stateless-function": 0, | ||
58 | "react/sort-comp": 0, | ||
59 | "react/state-in-constructor": 0, | ||
60 | "react/static-property-placement": 0, | ||
61 | // eslint-plugin-jsx-a11y | ||
62 | "jsx-a11y/click-events-have-key-events": 1, | ||
63 | "jsx-a11y/mouse-events-have-key-events": 1, | ||
64 | "jsx-a11y/label-has-for": [ | ||
65 | 2, | ||
66 | { | ||
67 | "components": ["Label"], | ||
68 | "required": { | ||
69 | "every": ["id"] | ||
70 | }, | ||
71 | "allowChildren": false | ||
72 | } | ||
73 | ], | ||
74 | "jsx-a11y/no-static-element-interactions": 0, | ||
75 | "jsx-a11y/no-noninteractive-element-interactions": 1 | ||
51 | } | 76 | } |
52 | ], | 77 | } |
53 | "jsx-a11y/click-events-have-key-events": 1 | 78 | ], |
79 | "settings": { | ||
80 | "react": { | ||
81 | "pragma": "React", // Pragma to use, default to "React" | ||
82 | "version": "detect" // React version. "detect" automatically picks the version you have installed. | ||
83 | } | ||
54 | }, | 84 | }, |
55 | "globals": { | 85 | "globals": { |
56 | "window": true, | 86 | "window": true, |
57 | "document": true, | 87 | "document": true, |
58 | "ENV": true, | ||
59 | "FormData": true, | 88 | "FormData": true, |
60 | "localStorage": true, | 89 | "localStorage": true, |
61 | "navigator": true, | 90 | "navigator": true, |
62 | "Worker": true, | ||
63 | "atob": true, | ||
64 | "btoa": true, | ||
65 | "ga": true, | ||
66 | "mocha": true, | ||
67 | "Element": true, | 91 | "Element": true, |
68 | "electron": true | 92 | "use": true, |
93 | "FileReader": true | ||
69 | }, | 94 | }, |
70 | "env": { | 95 | "env": { |
71 | "jest/globals": true | 96 | "jest/globals": true |
97 | }, | ||
98 | "rules": { | ||
99 | // eslint | ||
100 | "arrow-parens": 0, | ||
101 | "class-methods-use-this": 0, | ||
102 | "consistent-return": 1, | ||
103 | "implicit-arrow-linebreak": 0, | ||
104 | "function-paren-newline": 0, | ||
105 | "max-len": 0, | ||
106 | "no-await-in-loop": 1, | ||
107 | "no-console": [1, { "allow": ["warn", "error"] }], | ||
108 | "no-param-reassign": 1, | ||
109 | "no-restricted-syntax": 0, | ||
110 | "no-underscore-dangle": 0, | ||
111 | "operator-linebreak": 0, | ||
112 | "prefer-destructuring": 1, | ||
113 | "object-curly-newline": 0, | ||
114 | // eslint-plugin-import | ||
115 | "import/extensions": 1, | ||
116 | "import/prefer-default-export": 0, | ||
117 | "import/no-extraneous-dependencies": 0, // various false positives, re-enable at some point | ||
118 | "import/no-unresolved": 1, | ||
119 | // eslint-plugin-react | ||
120 | "react/forbid-prop-types": 1, | ||
121 | "react/destructuring-assignment": 0, | ||
122 | "react/jsx-curly-newline": 0, | ||
123 | "react/jsx-filename-extension": 1, | ||
124 | "react/jsx-no-bind": 1, | ||
125 | "react/jsx-props-no-spreading": 0, | ||
126 | "react/prefer-stateless-function": 1, | ||
127 | "react/static-property-placement": 0, | ||
128 | "react/state-in-constructor": 1, | ||
129 | "react/sort-comp": 0, | ||
130 | // eslint-plugin-jsx-a11y | ||
131 | "jsx-a11y/click-events-have-key-events": 1, | ||
132 | "jsx-a11y/no-static-element-interactions": 1, | ||
133 | "jsx-a11y/no-noninteractive-element-interactions": 1 | ||
72 | } | 134 | } |
73 | } | 135 | } |