-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
87 lines (85 loc) · 2.9 KB
/
eslint.config.mjs
File metadata and controls
87 lines (85 loc) · 2.9 KB
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
import eslint from "@eslint/js";
import { defineConfig, globalIgnores } from "eslint/config";
import simpleImportSort from "eslint-plugin-simple-import-sort";
import tseslint from "typescript-eslint";
export default defineConfig(
globalIgnores(["dist/"]),
eslint.configs.recommended,
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
{
plugins: {
"simple-import-sort": simpleImportSort,
},
languageOptions: {
parserOptions: {
projectService: {
allowDefaultProject: ["eslint.config.mjs"],
},
},
},
linterOptions: {
reportUnusedDisableDirectives: true,
},
rules: {
"simple-import-sort/imports": [
"warn",
// Same order as the default but without newlines between groups.
{ groups: [["^\\u0000", "^node:", "^@?\\w", "^", "^\\."]] },
],
curly: ["error", "all"],
eqeqeq: "error",
"no-console": "warn",
"no-multi-assign": "error",
"no-return-assign": "error",
"no-restricted-syntax": ["error", "ForInStatement"],
"@typescript-eslint/require-await": "off",
"@typescript-eslint/prefer-for-of": "off",
"@typescript-eslint/array-type": "off",
"@typescript-eslint/consistent-type-definitions": "off",
"@typescript-eslint/consistent-indexed-object-style": "off",
"@typescript-eslint/consistent-generic-constructors": "off",
"@typescript-eslint/restrict-template-expressions": [
"error",
{
allowAny: false,
allowBoolean: false,
allowNullish: false,
allowNumber: true,
allowRegExp: false,
},
],
"@typescript-eslint/explicit-member-accessibility": [
"error",
{ accessibility: "no-public" },
],
"@typescript-eslint/no-unused-vars": [
"error",
{
varsIgnorePattern: "^_",
argsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
},
],
"@typescript-eslint/switch-exhaustiveness-check": "error",
"@typescript-eslint/no-namespace": ["error", { allowDeclarations: true }],
// Ensure that type-only imports can be elided when Node.js's
// type stripping is used enabled and/or tsconfig enables
// "verbatimModuleSyntax".
//
// The consistent-type-imports rule requires type-only imports to
// be explicit.
//
// The no-import-type-side-effects rule disallows imports like
// `import { type A } from "a"` that may get transpiled into empty
// imports like `import {} from "a"`. If such an empty import is
// actually needed (for its side-effects) then declare it explicitly
// with `import "a"`.
"@typescript-eslint/consistent-type-imports": [
"error",
{ fixStyle: "inline-type-imports" },
],
"@typescript-eslint/no-import-type-side-effects": "error",
},
},
);