-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
117 lines (116 loc) · 4.14 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
/** eslint-disable */
import stylistic from '@stylistic/eslint-plugin'
import pluginJs from "@eslint/js"
import tseslint from "typescript-eslint"
/** @type {import('eslint').Linter.Config[]} */
export default [
{
files: ["**/*.{js,ts}"],
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
plugins: {
'@stylistic': stylistic
},
},
pluginJs.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
{ rules: {
"semi": ["warn", "never"],
"constructor-super": "error",
"getter-return": "error",
"no-const-assign": "error",
"no-irregular-whitespace": "error",
"no-unused-vars": "warn",
"default-case": "error",
"default-case-last": "error",
"eqeqeq": "error",
"no-empty": "error",
"no-empty-function": ["warn", { "allow": ["constructors"]}],
"no-shadow": "warn",
"no-var": "error",
"prefer-const": "error",
"consistent-return": "warn",
"no-useless-constructor": "off",
"@typescript-eslint/explicit-function-return-type": "error",
"@typescript-eslint/consistent-type-exports": "warn",
"@typescript-eslint/dot-notation": "warn",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-empty-function": "warn",
"@typescript-eslint/explicit-member-accessibility": ["warn", { "overrides": {"constructors": "no-public"}}],
"@typescript-eslint/naming-convention": ["warn",
{
"selector": "default",
"format": ["snake_case"]
},
{
"selector": "import",
"format": ["PascalCase"]
},
{
"selector": ["property", "parameterProperty"],
"modifiers": ["private"],
"format": ["snake_case"],
"leadingUnderscore": "require"
},
{
"selector": "variable",
"modifiers": ["global"],
"format": ["UPPER_CASE"]
},
{
"selector": "enumMember",
"format": ["UPPER_CASE"]
},
{
"selector": ["class", "typeLike"],
"format": ["PascalCase"]
},
{
"selector": ["classProperty"],
"modifiers": ["readonly"],
"format": ["UPPER_CASE"],
}
],
"@typescript-eslint/no-unused-vars": "off",
"@stylistic/indent": ["warn", 4],
"@stylistic/nonblock-statement-body-position": ["warn", "beside"],
"@stylistic/padded-blocks": ["warn", "never"],
"@stylistic/no-multi-spaces": "warn",
"@stylistic/no-multiple-empty-lines": "warn",
"@stylistic/no-trailing-spaces": "warn",
"@stylistic/no-whitespace-before-property": "warn",
"@stylistic/type-annotation-spacing": "warn",
"@stylistic/type-generic-spacing": "warn",
"@stylistic/operator-linebreak": ["warn", "before"],
"@stylistic/space-infix-ops": "warn",
"@stylistic/space-unary-ops": "warn",
"@stylistic/comma-dangle": ["warn", "never"],
"@stylistic/comma-spacing": "warn",
"@stylistic/comma-style": ["warn", "last"],
"@stylistic/array-bracket-newline": ["warn", "consistent"],
"@stylistic/array-bracket-spacing": ["warn", "always"],
"@stylistic/brace-style": ["warn", "stroustrup", { "allowSingleLine": true }],
"@stylistic/curly-newline": ["warn", { "consistent": true }],
"@stylistic/function-paren-newline": ["warn", "multiline"],
"@stylistic/new-parens": "warn",
"@stylistic/object-curly-newline": ["warn", { "multiline": true }],
"@stylistic/object-curly-spacing": ["warn", "always"],
"@stylistic/space-before-function-paren": ["warn", "never"],
"@stylistic/space-in-parens": ["warn", "never"],
"@stylistic/template-curly-spacing": "warn",
"@stylistic/arrow-spacing": "warn",
"@stylistic/block-spacing": "warn",
"@stylistic/function-call-spacing": "warn",
"@stylistic/key-spacing": "warn",
"@stylistic/keyword-spacing": "warn",
"@stylistic/no-mixed-spaces-and-tabs": "warn",
"@stylistic/space-before-blocks": "warn",
"@stylistic/switch-colon-spacing": "warn",
"@stylistic/spaced-comment": ["warn", "always"]
}
}
]