forked from DTStack/ko
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
96 lines (96 loc) · 2.24 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
/**
* default eslintrc shouldn't contain react & vue config
* TODO: support react & vue framework eslint config when user select framework
*/
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 8,
sourceType: 'module',
},
extends: [
'standard',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'prettier',
],
plugins: ['import', 'react'],
env: {
browser: true,
node: true,
es6: true,
},
globals: {
expect: 'readable',
test: 'readable',
describe: 'readable',
beforeEach: 'readable',
afterEach: 'readable',
jest: 'readable',
},
rules: {
semi: 0,
strict: 0,
indent: [
2,
2,
{
SwitchCase: 1,
},
],
'arrow-body-style': 0,
'no-return-assign': 0,
'no-useless-constructor': 0,
'no-unused-expressions': 0,
eqeqeq: 0,
'no-console': 0,
'no-param-reassign': 0,
camelcase: 'off',
'space-before-function-paren': 0,
'no-use-before-define': 'off',
'import/no-extraneous-dependencies': [
'error',
{
optionalDependencies: false,
peerDependencies: false,
},
],
// typescript eslint configs
'@typescript-eslint/no-unused-vars': [
'error',
{
vars: 'all',
args: 'none',
ignoreRestSiblings: false,
},
],
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/explicit-member-accessibility': 0,
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/no-use-before-define': 0,
'@typescript-eslint/no-var-requires': 0,
'@typescript-eslint/interface-name-prefix': 0,
'@typescript-eslint/no-empty-interface': 0,
'@typescript-eslint/camelcase': 0,
'react/display-name': [0],
'react/sort-comp': 0,
'react/jsx-uses-react': 1,
'react/prefer-stateless-function': 0,
'react/jsx-closing-bracket-location': 0,
'react/prop-types': [
0,
{
ignore: ['children'],
},
],
'react/jsx-no-target-blank': 2,
'react/jsx-filename-extension': [
1,
{
extensions: ['.tsx', '.js', '.jsx'],
},
],
'react/react-in-jsx-scope': 0,
},
};