-
-
Notifications
You must be signed in to change notification settings - Fork 233
/
Copy patheslint.config.mjs
71 lines (68 loc) · 1.94 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
import eslint from "@eslint/js";
import prettierPlugin from "eslint-plugin-prettier";
import unusedImportsPlugin from "eslint-plugin-unused-imports";
import prettierExtends from "eslint-config-prettier";
import { fixupPluginRules } from "@eslint/compat";
import globals from "globals";
import tseslint from "typescript-eslint";
const globalToUse = {
...globals.browser,
...globals.serviceworker,
...globals.es2021,
...globals.worker,
...globals.node,
};
const ignores = [
".lintstagedrc.js",
"**/.yarn/**/*",
"**/dist/**/*",
"public/js/*",
".yarn/js/*",
"dist/**/*",
"coverage/**/*",
];
/** @type {import('@typescript-eslint/utils').FlatConfig.ConfigArray} */
const configs = tseslint.config(
{
ignores,
extends: [eslint.configs.recommended, ...tseslint.configs.recommended, prettierExtends],
plugins: {
prettierPlugin,
"unused-imports": fixupPluginRules(unusedImportsPlugin),
},
rules: {
"prefer-rest-params": "off",
"prefer-const": "error",
"prefer-spread": "off",
"no-case-declarations": "off",
curly: ["error", "all"],
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
"@typescript-eslint/consistent-type-imports": [
"error",
{
prefer: "type-imports",
},
],
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-use-before-define": ["off"],
"object-shorthand": "error",
"@typescript-eslint/no-unused-vars": [
"warn",
{ varsIgnorePattern: "^_", argsIgnorePattern: "^_", ignoreRestSiblings: true },
],
"unused-imports/no-unused-imports": "error",
},
languageOptions: {
globals: globalToUse,
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},
},
{ ignores },
);
export default configs;