-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
123 lines (120 loc) · 3.02 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
module.exports = {
root: true,
globals: {
__DEV__: true,
process: true,
window: true,
document: true
},
env: {
node: true
},
extends: ['eslint:recommended', 'plugin:prettier/recommended', 'prettier'],
parser: '@babel/eslint-parser',
parserOptions: {
sourceType: 'module',
requireConfigFile: false,
babelOptions: {
presets: [require.resolve('./index.js')]
}
},
plugins: ['@babel', '@stylistic/js', 'import'],
rules: {
'block-scoped-var': 'warn',
'curly': ['warn', 'multi-line'],
'eqeqeq': ['warn', 'smart'],
'no-alert': 'warn',
'no-array-constructor': 'warn',
'no-caller': 'error',
'no-catch-shadow': 'error',
'no-cond-assign': ['warn', 'except-parens'],
'no-constant-condition': 'warn',
'no-control-regex': 'off',
'no-debugger': 'off',
'no-div-regex': 'warn',
'no-empty': 'warn',
'no-eval': 'warn',
'no-extend-native': 'warn',
'no-extra-bind': 'warn',
'no-extra-boolean-cast': 'warn',
'no-extra-semi': 'off',
'no-fallthrough': 'warn',
'no-func-assign': 'warn',
'no-implied-eval': 'warn',
'no-inner-declarations': 'off',
'no-irregular-whitespace': 'warn',
'no-iterator': 'error',
'no-label-var': 'error',
'no-labels': 'error',
'no-mixed-spaces-and-tabs': ['warn', 'smart-tabs'],
'no-global-assign': 'error',
'no-unsafe-negation': 'error',
'no-new-func': 'error',
'no-new-object': 'warn',
'no-new-wrappers': 'warn',
'no-octal-escape': 'warn',
'no-proto': 'error',
'no-redeclare': [
'error',
{
builtinGlobals: true
}
],
'no-regex-spaces': 'warn',
'no-return-assign': ['warn', 'except-parens'],
'no-script-url': 'error',
'no-self-compare': 'error',
'no-sequences': 'warn',
'no-shadow': [
'warn',
{
builtinGlobals: true,
hoist: 'all',
allow: ['context']
}
],
'no-throw-literal': 'error',
'no-unexpected-multiline': 'warn',
'no-unneeded-ternary': 'warn',
'no-unreachable': 'warn',
'no-unused-vars': 'warn',
'no-use-before-define': [
'warn',
{
functions: false
}
],
'no-useless-call': 'warn',
'no-useless-escape': 'off',
'no-var': 'warn',
'require-yield': 'off',
'use-isnan': 'warn',
// @stylistic/js plugin https://github.com/eslint-stylistic/eslint-stylistic
'@stylistic/js/new-parens': 'warn',
'@stylistic/js/no-floating-decimal': 'warn',
'@stylistic/js/no-trailing-spaces': 'warn',
'@stylistic/js/wrap-iife': ['error', 'inside'],
// babel plugin https://github.com/babel/babel/tree/main/eslint/babel-eslint-plugin
'@babel/new-cap': [
'error',
{
newIsCap: true,
capIsNew: false
}
],
'@babel/no-unused-expressions': 'warn',
'import/no-unresolved': ['error', {commonjs: true, caseSensitive: true}],
'import/named': 'error',
'import/first': 'warn',
'import/no-duplicates': 'error',
'import/extensions': ['warn', 'always', {js: 'never', json: 'always'}],
'import/newline-after-import': 'warn',
'import/order': [
'warn',
{
'newlines-between': 'never',
'groups': ['builtin', 'external', 'internal', 'parent', 'sibling', 'index']
}
]
}
};