-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.mjs
68 lines (65 loc) · 1.72 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
// @ts-check
import nextPlugin from "@next/eslint-plugin-next";
import reactPlugin from "eslint-plugin-react";
import hooksPlugin from "eslint-plugin-react-hooks";
import mochaPlugin from "eslint-plugin-mocha";
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
import { fixupPluginRules } from "@eslint/compat";
const patchedNextPlugin = fixupPluginRules(nextPlugin);
const patchedHooksPlugin = fixupPluginRules(hooksPlugin);
export default [
{
ignores: [
"/.pnp",
".pnp.js",
".yarn/install-state.gz",
"**/.next/",
"websites/**/out/",
"/content",
"/test-content",
],
},
eslint.configs.recommended,
...tseslint.configs.recommended,
mochaPlugin.configs.flat.recommended,
{
files: ["**/*.ts", "**/*.tsx"],
plugins: {
react: reactPlugin,
"react-hooks": patchedHooksPlugin,
"@next/next": patchedNextPlugin,
mocha: mochaPlugin,
},
rules: {
...reactPlugin.configs["jsx-runtime"].rules,
...hooksPlugin.configs.recommended.rules,
...nextPlugin.configs.recommended.rules,
...nextPlugin.configs["core-web-vitals"].rules,
"@next/next/no-img-element": "error",
"@typescript-eslint/no-unused-vars": [
"error",
{
args: "all",
argsIgnorePattern: "^_",
caughtErrors: "all",
caughtErrorsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
varsIgnorePattern: "^_",
ignoreRestSiblings: true,
},
],
},
languageOptions: {
globals: {
process: "readonly",
module: "writable",
},
},
settings: {
next: {
rootDir: "websites/*/*",
},
},
},
];