This repository was archived by the owner on Feb 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
95 lines (95 loc) · 2.42 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
87
88
89
90
91
92
93
94
95
module.exports = {
env: {
browser: true,
es6: true,
},
extends: [
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
'airbnb',
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2018,
sourceType: 'module',
},
plugins: [
'react',
'@typescript-eslint',
],
rules: {
'import/extensions': [
'error',
'always',
{
ts: 'never',
tsx: 'never',
js: 'never',
jsx: 'never',
},
],
'no-nested-ternary': ['off'],
'no-restricted-syntax': [
'error',
{
selector: 'ForInStatement',
message: 'for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.',
},
{
selector: 'LabeledStatement',
message: 'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.',
},
{
selector: 'WithStatement',
message: '`with` is disallowed in strict mode because it makes code impossible to predict and optimize.',
},
],
'@typescript-eslint/camelcase': ['error', {
allow: ['current_password', 'password_confirmation'],
}],
'react/jsx-filename-extension': [
'warn',
{
extensions: ['.jsx', '.tsx']
}
],
'react/jsx-props-no-spreading': ['error', {
custom: 'ignore',
}],
'react/prop-types': ['error', {
skipUndeclared: true,
}],
'react/no-array-index-key': ['off'],
'jsx-a11y/label-has-associated-control': ['off'],
'jsx-a11y/no-autofocus': ['off'],
'jsx-a11y/anchor-is-valid': ['error', {
components: ['Link'],
specialLink: ['to'],
aspects: ['noHref'],
}],
'jsx-a11y/click-events-have-key-events': ['off'],
'jsx-a11y/no-noninteractive-element-interactions': ['off'],
'jsx-a11y/no-static-element-interactions': ['off'],
},
settings: {
'import/extensions': ['.js', '.jsx', '.ts', '.tsx'],
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
'node': {
'extensions': ['.js', '.jsx', '.ts', '.tsx'],
},
webpack: {
config: 'config/webpack/development.js',
},
},
},
};