-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
76 lines (76 loc) · 1.81 KB
/
.eslintrc.cjs
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
module.exports = {
root: true,
env: {
browser: false,
commonjs: true,
es6: true,
node: true,
mocha: true,
},
extends: [
'airbnb',
'airbnb-typescript',
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
ignorePatterns: ['coverage'],
plugins: ['@typescript-eslint', 'prettier'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: false,
},
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.eslint.json'],
},
// tips: 0 = 0, 1 = 1, 2 = 2
rules: {
// ==================== native eslint ====================
'max-classes-per-file': 0,
'no-case-declarations': 0,
'no-underscore-dangle': 0,
'no-const-assign': 1,
'no-this-before-super': 1,
'no-undef': 1,
'no-unreachable': 1,
'no-unused-vars': 1,
'constructor-super': 1,
'valid-typeof': 1,
'no-plusplus': 0,
'no-param-reassign': 0,
'no-new': 0,
'no-restricted-syntax': 0,
'no-console': 0,
'global-require': 0,
'no-continue': 0,
'consistent-return': 0,
// ==================== typescript ====================
'@typescript-eslint/no-unused-expressions': [
1,
{
allowShortCircuit: true,
},
],
'@typescript-eslint/no-unused-vars': 1,
'@typescript-eslint/naming-convention': [
2,
{
selector: 'variable',
format: ['camelCase', 'UPPER_CASE'],
leadingUnderscore: 'allow',
trailingUnderscore: 'allow',
},
],
// ==================== plugin:import ====================
'import/prefer-default-export': 0,
'import/no-dynamic-require': 0,
'import/no-extraneous-dependencies': 0,
},
settings: {
react: {
version: '^18.0.0',
},
},
};