-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy patheslint.config.mjs
61 lines (59 loc) · 2.66 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
// @ts-check
import tseslint from "typescript-eslint";
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
export default tseslint.config(
// https://typescript-eslint.io/getting-started/typed-linting/
tseslint.configs.strictTypeChecked,
tseslint.configs.stylisticTypeChecked,
tseslint.configs.recommendedTypeChecked,
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
// https://github.com/prettier/eslint-plugin-prettier
eslintPluginPrettierRecommended,
//
{
rules: {
"@typescript-eslint/array-type": "off",
"@typescript-eslint/consistent-indexed-object-style": "warn",
"@typescript-eslint/consistent-type-definitions": "off",
"@typescript-eslint/no-base-to-string": "warn",
"@typescript-eslint/no-confusing-void-expression": "warn",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-empty-function": "warn", // this is to satisfy maplibre-gl custom layer interface
"@typescript-eslint/no-floating-promises": "warn",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-misused-promises": "warn",
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "off",
"@typescript-eslint/no-unnecessary-condition": "warn",
"@typescript-eslint/no-unnecessary-type-arguments": "off",
"@typescript-eslint/no-unnecessary-type-assertion": "off",
"@typescript-eslint/no-unnecessary-type-parameters": "warn",
"@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/no-unsafe-argument": "warn",
"@typescript-eslint/no-unsafe-assignment": "warn",
"@typescript-eslint/no-unsafe-call": "warn",
"@typescript-eslint/no-unsafe-enum-comparison": "off",
"@typescript-eslint/no-unsafe-member-access": "warn",
"@typescript-eslint/no-unsafe-return": "warn",
"@typescript-eslint/no-non-null-assertion": "warn",
"@typescript-eslint/non-nullable-type-assertion-style": "warn",
"@typescript-eslint/prefer-for-of": "off",
"@typescript-eslint/prefer-nullish-coalescing": "warn",
"@typescript-eslint/prefer-optional-chain": "off",
"@typescript-eslint/prefer-return-this-type": "off",
"@typescript-eslint/prefer-string-starts-ends-with": "warn",
"@typescript-eslint/restrict-plus-operands": "warn",
"@typescript-eslint/restrict-template-expressions": "warn",
"@typescript-eslint/related-getter-setter-pairs": "off",
"@typescript-eslint/unbound-method": "warn",
"@typescript-eslint/use-unknown-in-catch-callback-variable": "warn",
},
},
//
);