-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
129 lines (124 loc) · 4.55 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import stylistic from "@stylistic/eslint-plugin";
import tsParser from "@typescript-eslint/parser";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});
export default [
...compat.extends("plugin:@typescript-eslint/strict-type-checked"),
{
plugins: {
"@typescript-eslint": typescriptEslint,
"@stylistic": stylistic,
},
languageOptions: {
parser: tsParser,
ecmaVersion: 5,
sourceType: "script",
parserOptions: {
parser: "@typescript-eslint/parser",
project: [
"./tsconfig.json"
],
},
},
rules: {
"@stylistic/array-bracket-newline": ["error", "consistent"],
"@stylistic/array-bracket-spacing": ["error"],
"@stylistic/array-element-newline": ["error", "consistent"],
"@stylistic/arrow-parens": ["error", "as-needed"],
"@stylistic/arrow-spacing": ["error"],
"@stylistic/block-spacing": ["error"],
"@stylistic/brace-style": ["error"],
"@stylistic/comma-dangle": ["error"],
"@stylistic/comma-spacing": ["error"],
"@stylistic/comma-style": ["error"],
"@stylistic/computed-property-spacing": ["error"],
"@stylistic/dot-location": ["error", "property"],
"@stylistic/eol-last": ["error"],
"@stylistic/function-call-argument-newline": ["error", "consistent"],
"@stylistic/function-call-spacing": ["error"],
"@stylistic/function-paren-newline": ["error"],
"@stylistic/generator-star-spacing": ["error", "after"],
"@stylistic/implicit-arrow-linebreak": ["error"],
"@stylistic/indent": ["error", "tab"],
"@stylistic/indent-binary-ops": ["error", "tab"],
"@stylistic/key-spacing": ["error"],
"@stylistic/keyword-spacing": ["error"],
"@stylistic/linebreak-style": ["error"],
"@stylistic/lines-around-comment": ["error"],
"@stylistic/lines-between-class-members": ["error"],
"@stylistic/max-len": ["error", {
code: 80,
tabWidth: 1,
}],
"@stylistic/max-statements-per-line": ["error"],
"@stylistic/member-delimiter-style": ["error"],
"@stylistic/multiline-ternary": ["error", "always-multiline"],
"@stylistic/new-parens": ["error"],
"@stylistic/newline-per-chained-call": ["error", {
ignoreChainWithDepth: 3,
}],
"@stylistic/no-confusing-arrow": ["error", {
allowParens: true,
}],
"@stylistic/no-extra-parens": ["error", "all", {
enforceForArrowConditionals: false,
nestedBinaryExpressions: false,
}],
"@stylistic/no-extra-semi": ["error"],
"@stylistic/no-floating-decimal": ["error"],
"@stylistic/no-mixed-operators": ["error"],
"@stylistic/no-mixed-spaces-and-tabs": ["error"],
"@stylistic/no-multi-spaces": ["error"],
"@stylistic/no-multiple-empty-lines": ["error"],
"@stylistic/no-tabs": ["error", {
allowIndentationTabs: true,
}],
"@stylistic/no-trailing-spaces": ["error"],
"@stylistic/no-whitespace-before-property": ["error"],
"@stylistic/nonblock-statement-body-position": ["error"],
"@stylistic/object-curly-newline": ["error"],
"@stylistic/object-curly-spacing": ["error", "always"],
"@stylistic/operator-linebreak": ["error"],
"@stylistic/padded-blocks": ["error", "never"],
"@stylistic/quote-props": ["error", "as-needed"],
"@stylistic/quotes": ["error"],
"@stylistic/rest-spread-spacing": ["error"],
"@stylistic/semi": ["error"],
"@stylistic/semi-spacing": ["error"],
"@stylistic/semi-style": ["error"],
"@stylistic/space-before-blocks": ["error"],
"@stylistic/space-before-function-paren": ["error", {
anonymous: "always",
named: "never",
asyncArrow: "always",
}],
"@stylistic/space-in-parens": ["error"],
"@stylistic/space-infix-ops": ["error"],
"@stylistic/space-unary-ops": ["error"],
"@stylistic/spaced-comment": ["error"],
"@stylistic/switch-colon-spacing": ["error"],
"@stylistic/template-curly-spacing": ["error"],
"@stylistic/template-tag-spacing": ["error"],
"@stylistic/type-annotation-spacing": ["error"],
"@stylistic/type-generic-spacing": ["error"],
"@stylistic/type-named-tuple-spacing": ["error"],
"@stylistic/wrap-iife": ["error"],
"@stylistic/wrap-regex": ["error"],
"@stylistic/yield-star-spacing": ["error"],
"@typescript-eslint/restrict-template-expressions": ["error", {
allowNumber: true,
allowBoolean: true,
}],
},
}
];