-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
64 lines (63 loc) · 1.79 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
import eslint from "@eslint/js";
import prettierRecommended from "eslint-plugin-prettier/recommended";
import simpleImportSort from "eslint-plugin-simple-import-sort";
import tseslint from "typescript-eslint";
export default [
eslint.configs.recommended,
...tseslint.configs.strictTypeChecked,
prettierRecommended,
{
plugins: {
"simple-import-sort": simpleImportSort,
},
linterOptions: {
reportUnusedDisableDirectives: true,
},
languageOptions: {
parserOptions: {
projectService: {
allowDefaultProject: ["eslint.config.mjs"],
},
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
"simple-import-sort/imports": [
"warn",
// Same order as the default but without newlines between groups.
{ groups: [["^\\u0000", "^node:", "^@?\\w", "^", "^\\."]] },
],
"prettier/prettier": ["warn"],
curly: ["error", "all"],
eqeqeq: "error",
"no-console": "warn",
"no-multi-assign": "error",
"no-return-assign": "error",
"no-unused-expressions": "error",
"no-restricted-syntax": ["error", "ForInStatement"],
"@typescript-eslint/explicit-member-accessibility": [
"error",
{ accessibility: "no-public" },
],
"@typescript-eslint/no-unused-vars": [
"error",
{
varsIgnorePattern: "^_",
argsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
},
],
"@typescript-eslint/restrict-template-expressions": [
"error",
{
allowAny: false,
allowBoolean: false,
allowNullish: false,
allowNumber: true,
allowRegExp: false,
},
],
"@typescript-eslint/switch-exhaustiveness-check": "error",
},
},
];