-
-
Notifications
You must be signed in to change notification settings - Fork 265
/
Copy patheslint.config.mjs
122 lines (117 loc) · 2.65 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
import globals from "globals";
import tsPlugin from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";
import styPlugin from "@stylistic/eslint-plugin";
// https://www.npmjs.com/package/eslint-config-mdcs
const mdcs = {
globals: {
THREE: "readonly",
console: "writable",
},
rules: {
"array-bracket-spacing": [
"error",
"always",
{ singleValue: true, arraysInArrays: false }
],
"block-spacing": [ "error", "always" ],
"brace-style": [ "error", "1tbs", { allowSingleLine: true } ],
"comma-spacing": [ "error", { before: false, after: true } ],
"comma-style": [ "error", "last" ],
"computed-property-spacing": [ "error", "always" ],
"eol-last": [ "error", "always" ],
"func-call-spacing": [ "error", "never" ],
"indent": [ "error", "tab", { SwitchCase: 1 } ],
"key-spacing": [ "error", { beforeColon: false } ],
"new-parens": "error",
"no-trailing-spaces": [ "error", { skipBlankLines: false } ],
"no-whitespace-before-property": "error",
"object-curly-spacing": [ "error", "always" ],
"padded-blocks": [
"error",
{
blocks: "always",
switches: "always",
classes: "always"
}
],
"semi": [
"error",
"always",
{ "omitLastInOneLineBlock": true }
],
"semi-spacing": [ "error", { before: false, after: true } ],
"space-before-blocks": [ "error", {
functions: "always",
keywords: "always",
classes: "always"
} ],
"space-before-function-paren": [
"error",
{
anonymous: "always",
named: "never",
asyncArrow: "ignore"
}
],
"space-in-parens": [ "error", "always" ],
"space-infix-ops": [ "error" ],
"space-unary-ops": [
"error",
{
words: true,
nonwords: true,
overrides: {}
}
],
"keyword-spacing": [ "error", { before: true, after: true } ],
"padding-line-between-statements": [
"error",
{ blankLine: "always", prev: "block-like", next: "*" }
],
"no-multi-spaces": "error",
"no-undef": "warn",
"no-unused-vars": "warn",
"no-extra-semi": "warn"
}
};
export default [
{
files: [ "src/**/*.ts" ],
// ignores: [],
languageOptions: {
parser: tsParser,
globals: {
...globals.browser,
...globals.node,
...mdcs.globals,
},
},
plugins: {
"@typescript-eslint": tsPlugin,
"@stylistic": styPlugin,
},
rules: {
...mdcs.rules,
"no-unused-vars": 0,
"@typescript-eslint/no-unused-vars": 1,
"indent": 0,
"@stylistic/indent": [
"error",
"tab",
{
SwitchCase: 1,
flatTernaryExpressions: true,
},
],
"no-multi-spaces": [ 0 ],
"no-trailing-spaces": [
"error",
{
ignoreComments: true,
},
],
"key-spacing": [ 0 ],
},
},
];