-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
110 lines (107 loc) · 3.44 KB
/
eslint.config.mjs
File metadata and controls
110 lines (107 loc) · 3.44 KB
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
// @ts-check
import tseslint from 'typescript-eslint';
import stylistic from '@stylistic/eslint-plugin';
const eslintConfig = tseslint.config(
{
files: [
'**/*.ts',
'**/*.mts',
'**/*.cts'
],
ignores: [
'**/*.js',
],
plugins: {
'@typescript-eslint': tseslint.plugin,
'@stylistic': stylistic,
},
languageOptions: {
parser: tseslint.parser,
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
'arrow-parens': [
'warn',
'as-needed',
{
requireForBlockBody: false,
},
],
curly: 'warn',
eqeqeq: 'warn',
'no-fallthrough': 'warn',
'no-restricted-syntax': [
'warn',
{
selector: "VariableDeclaration[kind = 'let'] > VariableDeclarator[init = null]:not([id.typeAnnotation])",
message: 'Type must be inferred at variable declaration',
},
],
'no-trailing-spaces': [
'warn',
{
skipBlankLines: true,
ignoreComments: true,
},
],
'no-unreachable': 'warn',
'no-var': 'warn',
'prefer-const': 'warn',
quotes: [
'warn',
'single',
{
avoidEscape: true,
},
],
yoda: 'warn',
'@stylistic/quote-props': [
'warn',
'as-needed',
],
'@typescript-eslint/ban-ts-comment': 'warn',
'@typescript-eslint/await-thenable': 'warn',
'@typescript-eslint/explicit-function-return-type': [
'warn',
{
allowExpressions: true,
},
],
'@typescript-eslint/explicit-member-accessibility': 'warn',
'@typescript-eslint/require-await': 'warn',
'@typescript-eslint/no-deprecated': 'error',
'@typescript-eslint/no-duplicate-enum-values': 'warn',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-floating-promises': 'warn',
'@typescript-eslint/no-inferrable-types': 'warn',
'@typescript-eslint/no-unnecessary-condition': [
'warn',
{
allowConstantLoopConditions: true,
},
],
'@typescript-eslint/no-unnecessary-type-assertion': 'warn',
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrors: 'all',
caughtErrorsIgnorePattern: '^_',
},
],
'@typescript-eslint/strict-boolean-expressions': 'warn',
'@typescript-eslint/switch-exhaustiveness-check': [
'warn',
{
considerDefaultExhaustiveForUnions: true,
requireDefaultForNonUnion: true,
}
],
},
},
);
export default eslintConfig;