-
Notifications
You must be signed in to change notification settings - Fork 1k
/
eslint.config.mjs
46 lines (41 loc) · 1.31 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
// @ts-check
import tseslint from "typescript-eslint"
import { FlatCompat } from "@eslint/eslintrc"
import eslintPluginJsxA11y from "eslint-plugin-jsx-a11y"
import eslintPluginReact from "eslint-plugin-react"
const compat = new FlatCompat({
baseDirectory: import.meta.dirname,
})
export default tseslint.config(
tseslint.configs.recommended,
...compat.config({
extends: ["next"],
rules: {
// react
"react/prop-types": "off",
"react/no-unescaped-entities": "off",
"react/jsx-curly-brace-presence": "warn",
// jsx-ally is already included in next-js so
// we are adding only recommended rules directly here
...eslintPluginJsxA11y.flatConfigs.recommended.rules,
"jsx-a11y/no-onchange": "warn",
// import
"import/no-anonymous-default-export": "off",
// next
"@next/next/no-img-element": "off",
},
}),
// @ts-expect-error eslintPluginReact.configs.flat, but runtime is always defined
eslintPluginReact.configs.flat["jsx-runtime"],
{
linterOptions: {
reportUnusedDisableDirectives: "error",
},
rules: {
// typescript
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
},
}
)