-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
86 lines (86 loc) · 2.18 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
module.exports = {
env: {
jest: true,
browser: true,
commonjs: true,
es6: true,
node: true,
},
extends: [
'airbnb',
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 12,
},
plugins: [
'react',
'@typescript-eslint',
],
rules: {
'react/require-default-props': 'off',
'import/prefer-default-export': 'off',
'react/destructuring-assignment': 'off',
'react/jsx-first-prop-new-line': 'off',
'react/prop-types': 'off',
'react/jsx-props-no-spreading': 'off',
'react/jsx-max-props-per-line': 'off',
'import/no-named-as-default': 'off',
'react/jsx-one-expression-per-line': 'off',
'no-unused-vars': 'off',
'no-use-before-define': 'off',
'react/no-array-index-key': 'off',
'object-curly-newline': 'off',
'jsx-a11y/anchor-is-valid': 'off', // invalid - <Link> autopasses href
'max-len': ['error', { code: 120 }],
'jsx-a11y/click-events-have-key-events': ['warn'],
'jsx-a11y/no-static-element-interactions': ['warn'],
'@typescript-eslint/no-unused-vars': ['error'],
'@typescript-eslint/no-use-before-define': ['error'],
'import/no-extraneous-dependencies': ['error', {
devDependencies: ['**/*.test.*', '**/*.spec.*', './lib/node-only/*'],
optionalDependencies: false,
peerDependencies: false,
}],
'react/no-unescaped-entities': ['error', { forbid: ['>', '}'] }],
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx', '.tsx'] }],
'import/no-unresolved': 'error',
'no-multiple-empty-lines': ['error', {
max: 1,
maxEOF: 1,
}],
'import/extensions': ['error', {
svg: 'always',
json: 'always',
js: 'never',
ts: 'never',
tsx: 'never',
jsx: 'never',
}],
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {
alwaysTryTypes: true,
},
},
},
overrides: [
{
files: ['**/*.d.ts'],
rules: {
'no-undef': 'off',
},
},
],
};