forked from Snapmaker/Luban
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
84 lines (83 loc) · 2.39 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
const path = require('path');
module.exports = {
extends: 'snapmaker',
parser: '@babel/eslint-parser',
parserOptions: {
'requireConfigFile': false,
'babelOptions': {
'presets': ['@babel/preset-react']
}
},
env: {
browser: true,
node: true
},
settings: {
'import/resolver': {
webpack: {
config: {
resolve: {
modules: [
path.resolve(__dirname, 'src')
],
extensions: ['.js', '.jsx', '.ts']
}
}
}
}
},
'plugins': [
'react-hooks'
],
rules: {
'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks
'react-hooks/exhaustive-deps': 'warn', // Checks effect dependencies
'react/jsx-no-bind': [1, {
'allowArrowFunctions': true
}],
'jsx-a11y/control-has-associated-label': 0,
'react/state-in-constructor': 0,
'react/sort-comp': 0,
'react/static-property-placement': 0,
'react/prefer-stateless-function': 0,
'react/no-access-state-in-setstate': 0,
'react/jsx-props-no-spreading': 0,
'react/jsx-indent': 0,
'react/no-deprecated': 'warn',
'react/jsx-fragments': 0,
'import/extensions': ['error', 'never', {
'styl': 'always',
'json': 'always'
}],
'no-self-assign': 0,
'prefer-object-spread': 0,
'no-async-promise-executor': 0,
'comma-dangle': 0,
'no-multiple-empty-lines': 0,
'no-var': 'error',
'no-await-in-loop': 0,
'no-loop-func': 0,
'indent': [2, 4, {
'SwitchCase': 1
}],
'no-constant-condition': [2, {
'checkLoops': false
}],
'spaced-comment': [1, 'always'],
'no-multi-str': 0,
'no-lonely-if': 0,
'no-bitwise': 0,
'max-classes-per-file': 0
},
overrides: [{
files: ['*.ts', '*.tsx'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
rules: {
'no-shadow': 'off',
'@typescript-eslint/no-shadow': ['error'],
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['error']
}
}]
};