-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.mjs
116 lines (108 loc) · 3.05 KB
/
eslint.config.mjs
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
import eslint from '@eslint/js';
import markdown from '@eslint/markdown';
import globals from 'globals';
import tseslint from 'typescript-eslint';
export default [
// Global ignores
{
ignores: [
'todo.md',
'dist',
'node_modules',
'**/.yarn',
'**/.pnp.*',
'**/.vscode',
],
},
// Markdown code-blocks linting
...markdown.configs.processor,
// Typescript linting
...tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
),
// Configuration files
{
files: [
'*.js' // applies to top-level files only
],
languageOptions: {
globals: {
...globals.node,
}
}
},
// Custom rules
{
linterOptions: {
reportUnusedDisableDirectives: "error"
},
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'no-duplicate-imports': 'error',
'no-self-compare': 'error',
'no-template-curly-in-string': 'error',
'camelcase': 'error',
'curly': 'error',
'default-case': 'error',
'default-case-last': 'error',
'default-param-last': 'error',
'eqeqeq': 'error',
'max-depth': ['error', 4],
'max-nested-callbacks': ['error', 5],
'no-bitwise': 'error',
'no-empty-static-block': 'error',
'no-eq-null': 'error',
'no-eval': 'error',
'no-extend-native': 'error',
'no-extra-label': 'error',
'no-implicit-coercion': 'error',
'no-implicit-globals': 'error',
'no-implied-eval': 'error',
'no-invalid-this': 'error',
'no-iterator': 'error',
'no-label-var': 'error',
'no-lone-blocks': 'error',
'no-lonely-if': 'error',
'no-loop-func': 'error',
'no-negated-condition': 'error',
'no-new': 'error',
'no-new-func': 'error',
'no-new-wrappers': 'error',
'no-octal-escape': 'error',
'no-param-reassign': 'error',
'no-proto': 'error',
'no-return-assign': 'error',
'no-script-url': 'error',
'no-sequences': 'error',
'no-throw-literal': 'error',
'no-undef-init': 'error',
'no-unneeded-ternary': 'error',
'no-unused-expressions': 'error',
'no-useless-computed-key': 'error',
'no-useless-concat': 'error',
'no-useless-rename': 'error',
'no-useless-return': 'error',
'no-var': 'error',
'no-void': 'error',
'object-shorthand': ['error', 'always'],
'one-var': ['error', 'never'],
'operator-assignment': ['error', 'always'],
'prefer-arrow-callback': 'error',
'prefer-const': 'error',
'prefer-object-has-own': 'error',
'prefer-object-spread': 'error',
'prefer-promise-reject-errors': 'error',
'prefer-rest-params': 'error',
'prefer-spread': 'error',
'prefer-template': 'error',
'radix': 'error',
'require-await': 'error',
'strict': 'error',
'symbol-description': 'error',
'yoda': 'error',
},
},
];