-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.mjs
73 lines (71 loc) · 2.43 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
// @ts-check
/// <reference path="./eslint-typegen.d.ts" />
import pluginShigen from "@shigen/eslint-plugin";
import pluginStylistic from "@stylistic/eslint-plugin";
import pluginUnusedImports from "eslint-plugin-unused-imports";
import typegen from "eslint-typegen";
import tseslint from "typescript-eslint";
export default typegen([
{
ignores: [ "dist/**/*", ],
},
{
files: [ "**/*.?(c|m)@(j|t)s", ],
plugins: {
"stylistic": pluginStylistic,
"shigen": pluginShigen,
"unused-imports": pluginUnusedImports,
},
rules: {
"shigen/group-imports": [ "error", ],
"shigen/sort-imports": [ "error", { inlineTypes: "end", }, ],
"stylistic/quotes": [ "error", "double", { allowTemplateLiterals: true, }, ],
"stylistic/quote-props": [ "error", "consistent-as-needed", ],
"stylistic/semi": [ "error", "always", ],
"stylistic/semi-style": [ "error", "last", ],
"stylistic/semi-spacing": [ "error", { before: false, after: true, }, ],
"stylistic/comma-dangle": [ "error", {
arrays: "always",
objects: "always",
imports: "always-multiline",
exports: "always-multiline",
functions: "always-multiline",
}, ],
"stylistic/comma-spacing": [ "error", { before: false, after: true, }, ],
"stylistic/array-bracket-spacing": [ "error", "always", ],
"stylistic/object-curly-spacing": [ "error", "always", ],
"unused-imports/no-unused-imports": [ "error", ],
},
},
{
files: [ "**/*.?(c|m)ts", ],
languageOptions: {
// @ts-ignore
parser: tseslint.parser,
parserOptions: {
project: "tsconfig.test.json",
},
},
plugins: {
// @ts-ignore
ts: tseslint.plugin,
},
rules: {
"stylistic/member-delimiter-style": [ "error", { singleline: { requireLast: true, }, }, ],
"ts/adjacent-overload-signatures": [ "error", ],
"ts/no-import-type-side-effects": [ "error", ],
"ts/no-duplicate-type-constituents": [ "error", ],
"ts/no-implied-eval": [ "error", ],
"ts/no-non-null-asserted-nullish-coalescing": [ "error", ],
"ts/no-non-null-asserted-optional-chain": [ "error", ],
"ts/no-shadow": [ "error", ],
"ts/no-unnecessary-template-expression": [ "error", ],
"ts/no-unsafe-argument": [ "error", ],
"ts/no-unsafe-call": [ "error", ],
"ts/no-unsafe-member-access": [ "error", ],
"ts/no-unsafe-declaration-merging": [ "error", ],
"ts/no-unsafe-unary-minus": [ "error", ],
"ts/consistent-type-imports": [ "error", { fixStyle: "inline-type-imports", }, ],
},
},
]);