-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy patheslint.config.mjs
76 lines (67 loc) · 2.54 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
// @ts-check
import globals from "globals";
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
import stylisticTs from '@stylistic/eslint-plugin-ts';
export default tseslint.config(
{
extends: [
eslint.configs.recommended,
tseslint.configs.recommendedTypeChecked,
tseslint.configs.stylisticTypeChecked,
],
files: ["src/**/*.ts"],
ignores: [
"bin/",
"dist/",
"lib/**/*",
"**/__tests__/**/*"
],
plugins: {
'@stylistic/ts': stylisticTs,
'@typescript-eslint': tseslint.plugin,
},
languageOptions: {
sourceType: "module",
globals: {
...globals.browser,
...globals.node,
...globals.es2021,
...globals.webextensions,
},
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
"quotes": "error",
"key-spacing": ["error", { "align": "value" }],
"comma-dangle": ["error", "only-multiline"],
"object-curly-spacing": ["error", "always"],
"array-bracket-spacing": "error",
"indent": ["error", 2, { "SwitchCase": 1 }],
"sort-imports": ["error", { allowSeparatedGroups: true }],
"@stylistic/ts/semi": "error",
"@typescript-eslint/array-type": ["error", { default: "generic" }],
// The following rules override the default "error" setting.
// These cases should be investigated and the overrides
// should either be removed or set to "off".
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-floating-promises": "warn",
"@typescript-eslint/no-unsafe-argument": "warn",
"@typescript-eslint/no-unsafe-assignment": "warn",
"@typescript-eslint/no-unsafe-member-access": "warn",
"@typescript-eslint/no-unused-expressions": "warn",
"@typescript-eslint/no-unsafe-return": "warn",
"@typescript-eslint/no-unsafe-call": "warn",
"@typescript-eslint/prefer-promise-reject-errors": "warn",
"@typescript-eslint/prefer-regexp-exec": "warn",
"@typescript-eslint/prefer-nullish-coalescing": "warn",
"@typescript-eslint/consistent-type-definitions": "warn",
"@typescript-eslint/no-misused-promises": "warn",
"@typescript-eslint/dot-notation": "warn",
"@typescript-eslint/restrict-plus-operands": "warn",
},
},
);