-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
77 lines (76 loc) · 1.86 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
73
74
75
76
77
import js from "@eslint/js";
import globals from "globals";
import eslintReact from "eslint-plugin-react";
import eslintReactHooks from "eslint-plugin-react-hooks";
import eslintReactRefresh from "eslint-plugin-react-refresh";
import prettierPlugin from "eslint-plugin-prettier";
import eslintConfigPrettier from "eslint-config-prettier";
import eslintImport from "eslint-plugin-import";
export default [
{
plugins: {
"react-hooks": eslintReactHooks,
react: eslintReact,
"react-refresh": eslintReactRefresh,
prettier: prettierPlugin,
import: eslintImport,
},
},
{
ignores: ["node_modules", "dist"],
},
js.configs.recommended,
{
languageOptions: {
globals: {
...globals.node,
...globals.browser,
...globals.es2024,
},
parserOptions: eslintReact.configs.recommended.parserOptions,
},
},
{
files: ["**/*.{js,jsx}"],
rules: {
...eslintConfigPrettier.rules,
"no-console": "warn",
"react/jsx-no-target-blank": "off",
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
"prettier/prettier": [
"error",
{
endOfLine: "auto",
singleQuote: false,
tabWidth: 2,
trailingComma: "es5",
bracketSpacing: true,
},
],
"import/no-default-export": "error",
"no-unused-vars": [
"error",
{
vars: "all",
args: "after-used",
ignoreRestSiblings: true,
},
],
"func-style": ["error", "expression"],
"prefer-arrow-callback": ["error"],
"react/jsx-uses-vars": "error",
"no-shadow": "off",
"no-alert": "error",
eqeqeq: "error",
"react/jsx-no-undef": "error",
},
},
{
rules: {
"import/no-default-export": "off",
},
},
];