-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
73 lines (71 loc) · 2.22 KB
/
eslint.config.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
import js from "@eslint/js";
import ts from 'typescript-eslint';
import compat from 'eslint-plugin-compat'
export default [
js.configs.recommended,
compat.configs["flat/recommended"],
{
ignores: [
"build/",
"dist/",
"coverage/",
],
rules: {
"no-unused-vars": "warn",
"no-undef": "warn",
"indent": ["error", 4, {
"SwitchCase": 1,
"flatTernaryExpressions": true,
"ignoredNodes": ["ConditionalExpression", "LineComment"],
"MemberExpression": 1,
"FunctionDeclaration": { "parameters": "first" },
"FunctionExpression": { "parameters": "first" },
"ArrayExpression": "first",
"ObjectExpression": "first",
"ImportDeclaration": "first"
}],
"linebreak-style": ["error", "windows"],
"quotes": ["error", "double", {
"avoidEscape": true
}],
"semi": ["error", "never"],
"brace-style": ["warn", "stroustrup", {
"allowSingleLine": true
}],
},
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
...ts.configs.recommendedTypeChecked,
...ts.configs.stylisticTypeChecked,
{
files: ['**/*.ts'],
ignores: [
"**/*.js",
"**/*.mjs",
],
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
"no-restricted-syntax": [
"error",
// Ban all enums
{
"selector": "TSEnumDeclaration",
"message": "Use POJOs and/or union types instead of TS enums",
},
],
"@typescript-eslint/ban-ts-comment": ["error", {
"ts-ignore": "allow-with-description"
}],
},
}
];