forked from common-voice/common-voice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
55 lines (53 loc) · 1.35 KB
/
.eslintrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
module.exports = {
root: true,
env: {
node: true,
browser: true,
es2021: true,
},
plugins: ['import', '@typescript-eslint', 'react', 'react-hooks', 'jsx-a11y'],
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:jsx-a11y/recommended',
'prettier',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 12,
sourceType: 'module',
tsconfigRootDir: __dirname,
project: [
'tsconfig.eslint.json',
'./common/tsconfig.json',
'./web/tsconfig.json',
'./server/tsconfig.json',
],
},
rules: {
// turn on errors for missing imports
'import/no-unresolved': 'error',
// warn us if we're using @ts-ignore etc..
'@typescript-eslint/ban-ts-comment': 'warn',
// Old code uses any a lot, just show a warn instead
'@typescript-eslint/no-explicit-any': 'warn',
// Disabling this because it seems there is no way for ESLint to know we use Localized for translating text
'jsx-a11y/heading-has-content': 'off',
'jsx-a11y/anchor-has-content': 'off',
},
settings: {
react: {
version: 'latest',
},
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {},
},
},
};