-
Notifications
You must be signed in to change notification settings - Fork 20
/
eslint.config.mjs
109 lines (104 loc) · 3.06 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
104
105
106
107
108
109
// @ts-check
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
import mochaPlugin from "eslint-plugin-mocha";
import codegenPlugin from "eslint-plugin-codegen";
export default tseslint.config(
{
ignores: [
"node_modules",
"static",
"views",
"data",
"dist",
"coverage",
"mochawesome-report",
".nyc_output",
],
},
eslint.configs.recommended,
...tseslint.configs.recommended,
mochaPlugin.configs.flat.recommended,
{
plugins: {
"@typescript-eslint": tseslint.plugin,
"codegen": codegenPlugin,
},
languageOptions: {
parser: tseslint.parser,
parserOptions: {
project: true
},
}
},
{
files: [
"src/**/*.ts",
"test/**/*.ts",
],
rules: {
quotes: ["error", "double", { allowTemplateLiterals: true }],
semi: "error",
indent: ["error", 2, {
FunctionDeclaration: { parameters: "first" }
}],
"prefer-arrow-callback": "warn",
"eol-last": ["error", "always"],
"object-shorthand": ["error", "always"],
"no-unused-vars": 0,
"no-lonely-if": "warn",
"no-trailing-spaces": "warn",
"no-whitespace-before-property": "warn",
"no-multiple-empty-lines": "warn",
"space-before-blocks": "warn",
"space-in-parens": ["warn", "never"],
"space-infix-ops": "warn",
"eqeqeq": "warn",
"no-shadow": ["error"],
"no-var": ["error"],
"prefer-const": ["error"],
"one-var": ["error", { separateRequires: true }],
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/explicit-module-boundary-types": ["warn", {
allowArgumentsExplicitlyTypedAsAny: true,
allowDirectConstAssertionInArrowFunctions: true,
allowedNames: [],
allowHigherOrderFunctions: true,
allowTypedFunctionExpressions: true
}],
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
"@typescript-eslint/member-delimiter-style": ["error", {
multiline: { delimiter: "semi", requireLast: true },
singleline: { delimiter: "semi", requireLast: false }
}],
"@typescript-eslint/no-unused-vars": ["warn", {
ignoreRestSiblings: true,
argsIgnorePattern: "^_"
}],
"@typescript-eslint/no-non-null-assertion": 0,
"@typescript-eslint/space-before-function-paren": ["warn", {
anonymous: "never",
named: "never",
asyncArrow: "always"
}],
"@typescript-eslint/naming-convention": [
"error",
{ selector: "typeLike", format: ["StrictPascalCase"] },
{ selector: "variable", format: ["strictCamelCase", "UPPER_CASE", "StrictPascalCase"] },
{ selector: "variable", modifiers: ["destructured"], format: null }
],
"codegen/codegen": "error"
}
},
{
files: [
"test/**/*.ts"
],
rules: {
"prefer-arrow-callback": "off",
"mocha/no-identical-title": "off",
"mocha/no-setup-in-describe": "off",
"mocha/max-top-level-suites": "off",
}
}
);