-
Notifications
You must be signed in to change notification settings - Fork 2
/
eslint.config.js
35 lines (32 loc) · 1005 Bytes
/
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
// @ts-check
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 [
{
ignores: [".next/**", ".yarn/**"],
},
...[eslint.configs.recommended, ...tseslint.configs.recommended].map(conf => ({
...conf,
files: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"],
})),
{
files: ["**/*.ts", "**/*.tsx"],
plugins: {
react: reactPlugin,
"react-hooks": hooksPlugin,
"@next/next": nextPlugin,
},
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",
// Throws TypeError: context.getAncestors is not a function
"@next/next/no-duplicate-head": "off",
},
},
];