-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
98 lines (97 loc) · 2.27 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import path from "path";
import globals from "globals";
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
import nextPlugin from "@next/eslint-plugin-next";
import reactPlugin from "eslint-plugin-react";
import hooksPlugin from "eslint-plugin-react-hooks";
export default tseslint.config(
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},
},
},
eslint.configs.recommended,
tseslint.configs.recommended,
{
plugins: {
react: reactPlugin,
},
rules: {
...reactPlugin.configs["jsx-runtime"].rules,
},
settings: {
react: {
version: "detect",
},
},
},
{
plugins: {
"react-hooks": hooksPlugin,
},
rules: hooksPlugin.configs.recommended.rules,
},
{
plugins: {
"@next/next": nextPlugin,
},
rules: {
...nextPlugin.configs.recommended.rules,
...nextPlugin.configs["core-web-vitals"].rules,
"@next/next/no-html-link-for-pages": [
2,
path.join(import.meta.dirname, "website/app"),
],
},
},
{
// re-enable some that are disabled by tseslint recommended
rules: {
"no-unused-labels": "off",
"constructor-super": "error",
"getter-return": "error",
"no-const-assign": "error",
"no-dupe-args": "error",
"no-dupe-class-members": "error",
"no-dupe-keys": "error",
"no-func-assign": "error",
"no-import-assign": "error",
"no-new-symbol": "error",
"no-new-native-nonconstructor": "error",
"no-obj-calls": "error",
"no-setter-return": "error",
"no-this-before-super": "error",
"no-unreachable": "error",
"no-unsafe-negation": "error",
// "no-undef": "error",
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "__ignored",
varsIgnorePattern: "__ignored",
caughtErrorsIgnorePattern: "__ignored",
},
],
},
},
{
files: ["**/*.js"],
rules: {
"@typescript-eslint/no-require-imports": "off",
"no-unused-labels": "off",
},
},
{
ignores: [
"**/tests/unit-tests/coverage/",
"**/node_modules/",
"**/assets/",
"**/dist/",
"**/.next/",
],
},
);