-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.eslintrc.js
202 lines (201 loc) · 5.71 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
useJSXTextNode: true,
project: './tsconfig.json',
},
plugins: ['@typescript-eslint', 'prettier', 'react', 'jsx-a11y', 'lodash', 'import', 'react-hooks'],
extends: ['plugin:@typescript-eslint/recommended', 'prettier'],
settings: {
react: {
version: '16.9',
},
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
},
env: {
browser: true,
node: true,
es6: true,
},
globals: {
__html__: true,
figma: true,
React: true,
describe: true,
it: true,
expect: true,
jest: true,
beforeEach: true,
afterEach: true,
beforeAll: true,
afterAll: true,
test: true,
jsdom: true,
__DEV__: true,
__TEST__: true,
before: true,
after: true,
context: true,
assert: true,
},
rules: {
'@typescript-eslint/member-delimiter-style': 0,
'@typescript-eslint/explicit-function-return-type': 0,
'import/no-unresolved': 'error',
'import/named': 'error',
'import/default': 'error',
'import/export': 'error',
'import/no-self-import': 'error',
'import/order': [
'error',
{
groups: ['builtin', 'external', ['internal', 'parent', 'sibling'], 'index'],
'newlines-between': 'ignore',
},
],
'jsx-a11y/accessible-emoji': 'error',
'jsx-a11y/alt-text': 'error',
'jsx-a11y/anchor-has-content': 'error',
'jsx-a11y/anchor-is-valid': 'error',
'jsx-a11y/aria-activedescendant-has-tabindex': 'error',
'jsx-a11y/aria-props': 'error',
'jsx-a11y/aria-proptypes': 'error',
'jsx-a11y/aria-role': 'error',
'jsx-a11y/aria-unsupported-elements': 'error',
'jsx-a11y/click-events-have-key-events': 'error',
'jsx-a11y/heading-has-content': 'error',
'jsx-a11y/html-has-lang': 'error',
'jsx-a11y/iframe-has-title': 'error',
'jsx-a11y/img-redundant-alt': 'error',
'jsx-a11y/interactive-supports-focus': [
'error',
{
tabbable: [
'button',
'checkbox',
'link',
'progressbar',
'searchbox',
'slider',
'spinbutton',
'switch',
'textbox',
],
},
],
'jsx-a11y/label-has-for': [
'error',
{
required: {
every: ['id'],
},
},
],
'jsx-a11y/label-has-associated-control': 'error',
'jsx-a11y/media-has-caption': 'error',
'jsx-a11y/mouse-events-have-key-events': 'error',
'jsx-a11y/no-access-key': 'error',
'jsx-a11y/no-autofocus': [
'error',
{
ignoreNonDOM: true,
},
],
'jsx-a11y/no-distracting-elements': 'error',
'jsx-a11y/no-interactive-element-to-noninteractive-role': 'error',
'jsx-a11y/no-noninteractive-element-interactions': [
'error',
{
body: ['onError', 'onLoad'],
iframe: ['onError', 'onLoad'],
img: ['onError', 'onLoad'],
},
],
'jsx-a11y/no-noninteractive-element-to-interactive-role': 'error',
'jsx-a11y/no-noninteractive-tabindex': 'error',
'jsx-a11y/no-redundant-roles': 'error',
'jsx-a11y/no-static-element-interactions': 'error',
'jsx-a11y/role-has-required-aria-props': 'error',
'jsx-a11y/role-supports-aria-props': 'error',
'jsx-a11y/scope': 'error',
'jsx-a11y/tabindex-no-positive': 'error',
'prettier/prettier': ['error'],
'no-duplicate-imports': 'error',
'array-callback-return': 'error',
curly: ['error', 'all'],
'no-eval': 'error',
'no-implied-eval': 'error',
'no-param-reassign': ['error', { props: true }],
'no-return-assign': 'error',
'no-self-compare': 'error',
radix: 'error',
'no-array-constructor': 'error',
'no-new-wrappers': 'error',
'no-cond-assign': 'error',
'no-use-before-define': ['error', { functions: false }],
'no-undef': 'error',
eqeqeq: 'error',
camelcase: 'error',
'no-new-object': 'error',
'no-nested-ternary': 'error',
'no-unused-vars': ['error', { ignoreRestSiblings: true }],
'no-var': 'error',
'prefer-const': 'error',
'prefer-arrow-callback': 'error',
'arrow-body-style': ['error', 'as-needed'],
'new-cap': [
'error',
{
capIsNewExceptions: [
'Collection',
'DropTarget',
'DragDropContext',
'DragSource',
'Map',
'List',
'OrderedMap',
'OrderedSet',
'Record',
'Seq',
'Set',
],
},
],
'object-shorthand': ['error', 'properties'],
'no-useless-computed-key': 'error',
'require-await': 'error',
'react/jsx-no-undef': 'error',
'react/no-direct-mutation-state': 'error',
'react/react-in-jsx-scope': 'error',
'react/jsx-boolean-value': 'error',
'react/jsx-no-duplicate-props': 'error',
'react/jsx-key': 'error',
'react/jsx-uses-react': 'error',
'react/jsx-uses-vars': 'error',
'react/no-unknown-property': 'error',
'react/jsx-no-target-blank': 'error',
'react/no-string-refs': 'error',
'react/boolean-prop-naming': 'error',
'react/forbid-foreign-prop-types': 'error',
'react/no-is-mounted': 'error',
'react/no-render-return-value': 'error',
'react/void-dom-elements-no-children': 'error',
'react/no-typos': 'error',
'react/no-access-state-in-setstate': 'error',
'react/no-unescaped-entities': ['error', { forbid: ['>', '}'] }],
'react/no-unused-prop-types': 'error',
'react/no-find-dom-node': 'error',
'react/prefer-es6-class': 'error',
'react/no-deprecated': 'error',
'lodash/prefer-noop': 'error',
'react-hooks/rules-of-hooks': 'error',
},
}