-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
93 lines (92 loc) · 2.92 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
import js from "@eslint/js";
import tslintPlugin from "@typescript-eslint/eslint-plugin";
import tslintParser from "@typescript-eslint/parser";
import prettier from "eslint-config-prettier";
import tslint from "typescript-eslint";
export default [
js.configs.recommended,
...tslint.configs.recommendedTypeChecked,
prettier,
{
files: ["source/**/*"],
ignores: ["out/**", "**/esbuild.js"],
languageOptions: {
parser: tslintParser,
parserOptions: {
ecmaVersion: 2020,
sourceType: "module",
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
plugins: {
"@typescript-eslint": tslintPlugin,
},
rules: {
"@typescript-eslint/adjacent-overload-signatures": "error",
"@typescript-eslint/array-type": ["error", { default: "array", readonly: "array" }],
"@typescript-eslint/ban-tslint-comment": "error",
"@typescript-eslint/class-literal-property-style": ["error", "fields"],
"@typescript-eslint/consistent-generic-constructors": ["error", "constructor"],
"@typescript-eslint/consistent-indexed-object-style": ["error", "record"],
"@typescript-eslint/consistent-type-assertions": [
"error",
{ assertionStyle: "as", objectLiteralTypeAssertions: "allow" },
],
"@typescript-eslint/explicit-function-return-type": [
"error",
{
allowConciseArrowFunctionExpressionsStartingWithVoid: false,
allowDirectConstAssertionInArrowFunctions: true,
allowedNames: [],
allowExpressions: false,
allowFunctionsWithoutTypeParameters: false,
allowHigherOrderFunctions: true,
allowIIFEs: false,
allowTypedFunctionExpressions: true,
},
],
"@typescript-eslint/explicit-member-accessibility": ["error", { accessibility: "explicit" }],
"@typescript-eslint/no-empty-object-type": [
"error",
{
allowInterfaces: "always",
},
],
"@typescript-eslint/no-inferrable-types": [
"error",
{
ignoreParameters: false,
ignoreProperties: false,
},
],
"@typescript-eslint/no-misused-promises": [
"error",
{
checksConditionals: true,
checksSpreads: true,
checksVoidReturn: false,
},
],
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
args: "all",
argsIgnorePattern: "^_",
caughtErrors: "all",
caughtErrorsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
varsIgnorePattern: "^_",
ignoreRestSiblings: true,
},
],
"@typescript-eslint/prefer-readonly": "error",
// ESLint
curly: "error",
eqeqeq: "error",
"no-throw-literal": "error",
"no-unused-vars": "off",
},
},
];