-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
85 lines (84 loc) · 2.11 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
77
78
79
80
81
82
83
84
85
import next from "@next/eslint-plugin-next";
import typescript from "@typescript-eslint/eslint-plugin";
import typescriptParser from "@typescript-eslint/parser";
import importPlugin from "eslint-plugin-import";
import react from "eslint-plugin-react";
import reactHooks from "eslint-plugin-react-hooks";
import globals from "globals";
export default [
{
ignores: [
"node_modules/**",
".next/**",
"dist/**",
"build/**",
"public/**",
"dist/**",
"coverage/**",
],
},
{
files: ["**/*.{js,jsx,ts,tsx}"],
plugins: {
"@typescript-eslint": typescript,
react: react,
"react-hooks": reactHooks,
import: importPlugin,
"@next/next": next,
},
languageOptions: {
parser: typescriptParser,
parserOptions: {
ecmaVersion: 2024,
sourceType: "module",
project: "./tsconfig.json",
ecmaFeatures: {
jsx: true,
},
},
globals: {
...globals.browser,
...globals.node,
...globals.es2021,
React: true,
JSX: true,
},
},
linterOptions: {
reportUnusedDisableDirectives: true,
},
settings: {
react: {
version: "detect",
},
"import/resolver": {
typescript: true,
node: true,
},
},
rules: {
...typescript.configs.recommended.rules,
...typescript.configs.strict.rules,
...react.configs.recommended.rules,
...reactHooks.configs.recommended.rules,
...next.configs.recommended.rules,
...next.configs["core-web-vitals"].rules,
"react/react-in-jsx-scope": "off",
"react/prop-types": "off",
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/no-unused-vars": [
"error",
{ argsIgnorePattern: "^_" },
],
"@typescript-eslint/no-explicit-any": "warn",
"import/order": [
"error",
{
groups: ["builtin", "external", "internal"],
"newlines-between": "always",
alphabetize: { order: "asc", caseInsensitive: true },
},
],
},
},
];