-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.eslintrc.cjs
85 lines (80 loc) · 2.77 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
77
78
79
80
81
82
83
84
85
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json'
},
plugins: [
'@typescript-eslint'
],
env: {
node: true
},
extends: [
// Default ESLint rules
'eslint:recommended',
// TypeScript-specific rules
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
// Clean import rules
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript'
],
rules: {
'no-duplicate-imports': ['error'],
'no-tabs': ['error'],
'no-param-reassign': ['error'],
'no-proto': ['error'],
'prefer-const': ['error'],
'arrow-spacing': ['error'],
'prefer-template': ['warn'],
'prefer-destructuring': ['warn'],
'prefer-spread': ['warn'],
'no-useless-constructor': ['warn'],
'no-extra-parens': ['warn'],
'no-else-return': ['warn'],
'no-empty-function': ['warn'],
'@typescript-eslint/explicit-member-accessibility': ['error', {
overrides: {
constructors: 'off'
}
}],
'@typescript-eslint/no-floating-promises': ['error'],
'@typescript-eslint/no-require-imports': ['error'],
'@typescript-eslint/no-throw-literal': ['error'],
'@typescript-eslint/promise-function-async': ['error'],
'@typescript-eslint/prefer-readonly': ['error'],
'@typescript-eslint/prefer-for-of': ['error'],
'@typescript-eslint/prefer-as-const': ['error'],
// TODO This should be enabled later, failed since TS esModuleInterop option
'@typescript-eslint/no-unsafe-assignment': ['off'],
'@typescript-eslint/no-unsafe-return': ['off'],
'import/no-unresolved': ['off'],
'import/named': ['error'],
'import/no-absolute-path': ['error'],
'import/no-dynamic-require': ['error'],
'import/no-self-import': ['error'],
'import/no-unused-modules': ['error'],
'import/first': ['error'],
'import/no-duplicates': ['error'],
'import/extensions': ['error'],
'import/order': ['error', {
groups: [
['builtin', 'external'],
['internal', 'parent'],
['sibling', 'index']
],
'newlines-between': 'always',
alphabetize: {
order: 'asc',
caseInsensitive: true
}
}],
'import/newline-after-import': ['error'],
'import/no-default-export': ['error'],
'import/no-named-default': ['error'],
'import/no-mutable-exports': ['error'],
'import/no-deprecated': ['warn']
}
};