diff options
author | Markus Hatvan <markus_hatvan@aon.at> | 2021-09-14 19:58:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-14 19:58:52 +0200 |
commit | 95df3522a15631abc51a4295cae0ea401a8d4e1e (patch) | |
tree | e5eb0f368c947683f01458e912f21756fb0d99cb /.eslintrc.js | |
parent | docs: add sad270 as a contributor for bug, userTesting [skip ci] (#1941) (diff) | |
download | ferdium-app-95df3522a15631abc51a4295cae0ea401a8d4e1e.tar.gz ferdium-app-95df3522a15631abc51a4295cae0ea401a8d4e1e.tar.zst ferdium-app-95df3522a15631abc51a4295cae0ea401a8d4e1e.zip |
feat: add eslint-plugin-unicorn (#1936)
Diffstat (limited to '.eslintrc.js')
-rw-r--r-- | .eslintrc.js | 186 |
1 files changed, 186 insertions, 0 deletions
diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 000000000..057631708 --- /dev/null +++ b/.eslintrc.js | |||
@@ -0,0 +1,186 @@ | |||
1 | module.exports = { | ||
2 | root: true, | ||
3 | parser: '@babel/eslint-parser', | ||
4 | parserOptions: { | ||
5 | ecmaFeatures: { | ||
6 | jsx: true, | ||
7 | }, | ||
8 | ecmaVersion: 2018, | ||
9 | sourceType: 'module', | ||
10 | project: './tsconfig.json', | ||
11 | }, | ||
12 | extends: ['eslint-config-airbnb', 'plugin:unicorn/recommended'], | ||
13 | plugins: ['jest'], | ||
14 | settings: { | ||
15 | react: { | ||
16 | pragma: 'React', // Pragma to use, default to "React" | ||
17 | version: 'detect', // React version. "detect" automatically picks the version you have installed. | ||
18 | }, | ||
19 | }, | ||
20 | globals: { | ||
21 | window: true, | ||
22 | document: true, | ||
23 | FormData: true, | ||
24 | localStorage: true, | ||
25 | navigator: true, | ||
26 | Element: true, | ||
27 | use: true, | ||
28 | FileReader: true, | ||
29 | }, | ||
30 | env: { | ||
31 | browser: true, | ||
32 | es6: true, | ||
33 | node: true, | ||
34 | jest: true, | ||
35 | }, | ||
36 | overrides: [ | ||
37 | { | ||
38 | files: ['**/*.ts', '**/*.tsx'], | ||
39 | extends: ['airbnb-typescript', 'plugin:unicorn/recommended'], | ||
40 | parser: '@typescript-eslint/parser', | ||
41 | plugins: ['@typescript-eslint'], | ||
42 | rules: { | ||
43 | // eslint | ||
44 | 'arrow-parens': 0, | ||
45 | 'array-callback-return': 1, | ||
46 | 'class-methods-use-this': 0, | ||
47 | 'consistent-return': 0, | ||
48 | 'function-paren-newline': 0, | ||
49 | 'implicit-arrow-linebreak': 0, | ||
50 | 'linebreak-style': 0, | ||
51 | 'max-len': 0, | ||
52 | 'no-confusing-arrow': 0, | ||
53 | 'no-console': 0, | ||
54 | 'no-param-reassign': 0, | ||
55 | 'no-restricted-syntax': 0, | ||
56 | 'no-return-assign': 1, | ||
57 | 'no-underscore-dangle': 0, | ||
58 | 'no-use-before-define': 0, | ||
59 | 'prefer-destructuring': 1, | ||
60 | 'object-curly-newline': 0, | ||
61 | 'operator-linebreak': 0, | ||
62 | // @typescript-eslint | ||
63 | '@typescript-eslint/indent': 0, | ||
64 | '@typescript-eslint/no-shadow': 0, | ||
65 | '@typescript-eslint/no-unused-expressions': 0, | ||
66 | // eslint-plugin-import | ||
67 | 'import/extensions': 0, | ||
68 | 'import/no-cycle': 1, | ||
69 | 'import/no-extraneous-dependencies': 0, | ||
70 | 'import/no-unresolved': 0, | ||
71 | 'import/prefer-default-export': 0, | ||
72 | // eslint-plugin-react | ||
73 | 'react/destructuring-assignment': 0, | ||
74 | 'react/button-has-type': 0, | ||
75 | 'react/forbid-prop-types': 0, | ||
76 | 'react/jsx-curly-newline': 0, | ||
77 | 'react/jsx-no-bind': 0, | ||
78 | 'react/jsx-no-target-blank': 0, | ||
79 | 'react/jsx-props-no-spreading': 0, | ||
80 | 'react/no-deprecated': 1, | ||
81 | 'react/no-array-index-key': 0, | ||
82 | 'react/prefer-stateless-function': 0, | ||
83 | 'react/sort-comp': 0, | ||
84 | 'react/state-in-constructor': 0, | ||
85 | 'react/static-property-placement': 0, | ||
86 | // eslint-plugin-jsx-a11y | ||
87 | 'jsx-a11y/click-events-have-key-events': 1, | ||
88 | 'jsx-a11y/mouse-events-have-key-events': 1, | ||
89 | 'jsx-a11y/label-has-for': [ | ||
90 | 2, | ||
91 | { | ||
92 | components: ['Label'], | ||
93 | required: { | ||
94 | every: ['id'], | ||
95 | }, | ||
96 | allowChildren: false, | ||
97 | }, | ||
98 | ], | ||
99 | 'jsx-a11y/no-static-element-interactions': 0, | ||
100 | 'jsx-a11y/no-noninteractive-element-interactions': 1, | ||
101 | // eslint-plugin-unicorn | ||
102 | 'unicorn/filename-case': 0, | ||
103 | 'unicorn/no-null': 0, | ||
104 | 'unicorn/no-useless-undefined': 0, | ||
105 | 'unicorn/prefer-module': 0, | ||
106 | 'unicorn/prevent-abbreviations': 0, | ||
107 | 'unicorn/prefer-node-protocol': 0, | ||
108 | 'unicorn/import-style': [ | ||
109 | 2, | ||
110 | { | ||
111 | styles: { | ||
112 | path: { | ||
113 | named: true, | ||
114 | }, | ||
115 | }, | ||
116 | }, | ||
117 | ], | ||
118 | 'unicorn/consistent-destructuring': 0, | ||
119 | }, | ||
120 | }, | ||
121 | ], | ||
122 | rules: { | ||
123 | // eslint | ||
124 | 'arrow-parens': 0, | ||
125 | 'class-methods-use-this': 0, | ||
126 | 'consistent-return': 1, | ||
127 | 'implicit-arrow-linebreak': 0, | ||
128 | indent: 0, | ||
129 | 'function-paren-newline': 0, | ||
130 | 'linebreak-style': 0, | ||
131 | 'max-len': 0, | ||
132 | 'no-await-in-loop': 1, | ||
133 | 'no-console': [ | ||
134 | 1, | ||
135 | { | ||
136 | allow: ['warn', 'error'], | ||
137 | }, | ||
138 | ], | ||
139 | 'no-param-reassign': 1, | ||
140 | 'no-restricted-syntax': 0, | ||
141 | 'no-underscore-dangle': 0, | ||
142 | 'operator-linebreak': 0, | ||
143 | 'prefer-destructuring': 1, | ||
144 | 'object-curly-newline': 0, | ||
145 | // eslint-plugin-import | ||
146 | 'import/extensions': 0, | ||
147 | 'import/prefer-default-export': 0, | ||
148 | 'import/no-extraneous-dependencies': 0, // various false positives, re-enable at some point | ||
149 | 'import/no-unresolved': 0, | ||
150 | // eslint-plugin-react | ||
151 | 'react/forbid-prop-types': 1, | ||
152 | 'react/destructuring-assignment': 0, | ||
153 | 'react/jsx-curly-newline': 0, | ||
154 | 'react/jsx-filename-extension': 1, | ||
155 | 'react/jsx-one-expression-per-line': 0, | ||
156 | 'react/jsx-no-bind': 1, | ||
157 | 'react/jsx-props-no-spreading': 0, | ||
158 | 'react/prefer-stateless-function': 1, | ||
159 | 'react/prop-types': 0, | ||
160 | 'react/static-property-placement': 0, | ||
161 | 'react/state-in-constructor': 1, | ||
162 | 'react/sort-comp': 0, | ||
163 | // eslint-plugin-jsx-a11y | ||
164 | 'jsx-a11y/click-events-have-key-events': 1, | ||
165 | 'jsx-a11y/no-static-element-interactions': 1, | ||
166 | 'jsx-a11y/no-noninteractive-element-interactions': 1, | ||
167 | // eslint-plugin-unicorn | ||
168 | 'unicorn/filename-case': 0, | ||
169 | 'unicorn/no-null': 0, | ||
170 | 'unicorn/no-useless-undefined': 0, | ||
171 | 'unicorn/prefer-module': 0, | ||
172 | 'unicorn/prevent-abbreviations': 0, | ||
173 | 'unicorn/prefer-node-protocol': 0, | ||
174 | 'unicorn/import-style': [ | ||
175 | 2, | ||
176 | { | ||
177 | styles: { | ||
178 | path: { | ||
179 | named: true, | ||
180 | }, | ||
181 | }, | ||
182 | }, | ||
183 | ], | ||
184 | 'unicorn/consistent-destructuring': 0, | ||
185 | }, | ||
186 | }; | ||