-
Notifications
You must be signed in to change notification settings - Fork 5
/
eslint.js
55 lines (55 loc) · 1.91 KB
/
eslint.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 = {
overrides: [
{
files: ['*.{ts,tsx}'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
'jsx': true
}
}
}
],
env: {
browser: true,
node: true
},
plugins: ['@typescript-eslint', 'import', 'react', 'react-hooks'],
settings: {
"import/resolver": {
typescript: {}
}
},
rules: {
'@typescript-eslint/class-name-casing': 'error',
'@typescript-eslint/type-annotation-spacing': 'error',
'@typescript-eslint/member-delimiter-style': 'error',
// TODO: turn on when fix it: https://github.com/facebook/create-react-app/issues/7709
'@typescript-eslint/consistent-type-assertions': 0,
// '@typescript-eslint/consistent-type-assertions': ['error', {
// assertionStyle: 'as',
// objectLiteralTypeAssertions: 'never'
// }],
'@typescript-eslint/no-array-constructor': 'error',
'@typescript-eslint/no-empty-interface': 'error',
'@typescript-eslint/no-unused-vars': [
'error',
{ ignoreRestSiblings: true }
],
'no-undef': 'off', // see https://github.com/eslint/typescript-eslint-parser/issues/416
'import/prefer-default-export': 'off',
'import/extensions': ['error', 'always', {
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never'
}],
'space-infix-ops': 'off', // see https://github.com/eslint/typescript-eslint-parser/issues/449
'react/jsx-filename-extension': [1, { extensions: ['.jsx', '.tsx'] }],
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'react/prop-types': 'off'
}
};