-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.eslintrc.js
82 lines (82 loc) · 2.25 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
module.exports = {
env: {
browser: true,
es6: true,
node: true,
},
extends: ['eslint-config-ali/react', 'plugin:jsx-control-statements/recommended', 'prettier'],
parser: 'babel-eslint',
plugins: [
'eslint-plugin-react',
'eslint-plugin-react-hooks',
'import',
'compat',
'jsx-a11y',
'jsx-control-statements',
],
overrides: [
{
files: ['**/*.tsx', '**/*.ts'],
parser: '@typescript-eslint/parser',
extends: ['eslint-config-ali/typescript/react', 'prettier'],
plugins: ['@typescript-eslint'],
rules: {
'no-nested-ternary': 'off',
'max-len': 'off',
'jsx-control-statements/jsx-jcs-no-undef': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': [
1,
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^ignored?$',
},
],
'@typescript-eslint/interface-name-prefix': 'off',
indent: 0,
'no-param-reassign': ['error', { props: true, ignorePropertyModificationsFor: ['draft', 'state', 'acc'] }],
},
},
],
parserOptions: {
ecmaVersion: 2015,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
impliedStrict: true,
},
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx'],
moduleDirectory: ['node_modules', 'example', 'src'],
},
},
},
rules: {
'no-param-reassign': [
'error',
{
props: true,
ignorePropertyModificationsFor: ['draft', 'state'],
},
],
'import/prefer-default-export': 'off',
// 'react/jsx-filename-extension': [2, { 'extensions': ['.js', '.jsx', '.ts', '.tsx'] }],
'react/prop-types': 'off',
'arrow-body-style': 'off',
'max-len': 'off',
'no-nested-ternary': 'off',
'react/no-multi-comp': 'off',
'jsx-first-prop-new-line': 'off',
'no-unused-vars': 1,
'import/no-named-as-default': 'off',
'import/no-named-as-default-member': 'off',
'react-hooks/rules-of-hooks': 'error',
'no-console': 2,
'@typescript-eslint/ban-ts-ignore': 'off',
'react/jsx-no-undef': [2, { allowGlobals: true }],
},
};