-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
72 lines (70 loc) · 1.81 KB
/
eslint.config.js
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
import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";
import react from "eslint-plugin-react";
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import typescriptParser from "@typescript-eslint/parser";
import reactRecommended from "eslint-plugin-react/configs/recommended.js";
import unusedImports from "eslint-plugin-unused-imports";
// Begin fix
react.configs.recommended.plugins = { react };
react.configs.recommended.languageOptions = {
parserOptions: react.configs.recommended.parserOptions,
};
delete react.configs.recommended.parserOptions;
// End fix
export default [
react.configs.recommended,
{
ignores: ["dist/**/*"],
},
{
files: ["**/*.{js,jsx,mjs,cjs,ts,tsx}"],
ignores: ["dist/**/*"],
...reactRecommended,
settings: {
react: {
version: "detect",
},
},
languageOptions: {
ecmaVersion: "latest",
sourceType: "module",
parser: typescriptParser,
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
globals: {
...globals.serviceworker,
...globals.browser,
},
},
plugins: {
react,
},
},
{ languageOptions: { globals: { ...globals.browser, ...globals.node } } },
pluginJs.configs.recommended,
...tseslint.configs.recommended,
{
plugins: {
"@typescript-eslint": typescriptEslint,
"unused-imports": unusedImports,
},
rules: {
"no-unused-vars": "off", // or "@typescript-eslint/no-unused-vars": "off",
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": [
"warn",
{
vars: "all",
varsIgnorePattern: "^_",
args: "after-used",
argsIgnorePattern: "^_",
},
],
},
},
];