-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
103 lines (102 loc) · 3.6 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
import typescriptPlugin from "@typescript-eslint/eslint-plugin";
import typescriptParser from "@typescript-eslint/parser";
import prettierPlugin from "eslint-plugin-prettier";
import prettierConfig from "eslint-config-prettier";
import importSortPlugin from "eslint-plugin-simple-import-sort";
import globals from "globals";
export default [
{
ignores: ["node_modules/*", "dist/*", "coverage/*"],
},
prettierConfig,
{
files: ["**/*.ts"],
languageOptions: {
globals: globals.node,
parser: typescriptParser,
sourceType: "module",
ecmaVersion: 5,
parserOptions: {
project: ["./tsconfig.json"],
},
},
plugins: {
"@typescript-eslint": typescriptPlugin,
prettier: prettierPlugin,
"simple-import-sort": importSortPlugin,
},
rules: {
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"no-console": "off",
"@typescript-eslint/member-ordering": [
"error",
{
default: [
"signature",
"public-static-field",
"protected-static-field",
"private-static-field",
"public-decorated-field",
"protected-decorated-field",
"private-decorated-field",
"public-instance-field",
"protected-instance-field",
"private-instance-field",
"public-abstract-field",
"protected-abstract-field",
"public-constructor",
"protected-constructor",
"private-constructor",
"public-abstract-method",
"protected-abstract-method",
"public-static-method",
"protected-static-method",
"private-static-method",
"public-decorated-method",
"protected-decorated-method",
"private-decorated-method",
"public-instance-method",
"protected-instance-method",
"private-instance-method",
],
},
],
"@typescript-eslint/no-confusing-non-null-assertion": ["error"],
"@typescript-eslint/no-confusing-void-expression": ["error", { ignoreArrowShorthand: true }],
"@typescript-eslint/no-explicit-any": ["error"],
"@typescript-eslint/no-extra-non-null-assertion": ["error"],
"@typescript-eslint/no-floating-promises": ["error"],
"@typescript-eslint/no-non-null-asserted-optional-chain": ["error"],
"@typescript-eslint/no-non-null-assertion": ["error"],
"@typescript-eslint/no-require-imports": ["error"],
"@typescript-eslint/no-unnecessary-boolean-literal-compare": ["error"],
"@typescript-eslint/no-unnecessary-condition": ["error"],
"@typescript-eslint/no-useless-constructor": ["error"],
"@typescript-eslint/prefer-for-of": ["error"],
"@typescript-eslint/prefer-nullish-coalescing": ["error"],
"@typescript-eslint/prefer-readonly": ["error"],
"@typescript-eslint/promise-function-async": ["error", { checkArrowFunctions: false }],
"@typescript-eslint/switch-exhaustiveness-check": ["error"],
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/explicit-module-boundary-types": ["error"],
"@typescript-eslint/strict-boolean-expressions": ["warn"],
"@typescript-eslint/no-misused-promises": [
"error",
{
checksVoidReturn: {
arguments: false,
attributes: false,
},
},
],
"prettier/prettier": ["error"],
"no-restricted-imports": [
"error",
{
patterns: ["../*"],
},
],
},
},
];