-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.json
executable file
·53 lines (53 loc) · 1.64 KB
/
.eslintrc.json
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
{
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"airbnb",
"next/core-web-vitals",
"next",
"prettier"
],
"overrides": [
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@typescript-eslint/recommended", "airbnb-typescript"],
"plugins": ["@typescript-eslint"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json"
},
"rules": {
"@typescript-eslint/semi": [2, "always"],
// Use semicolon as member delimiter for interfaces and type
"@typescript-eslint/member-delimiter-style": 2
}
}
],
"plugins": ["react", "react-hooks"],
"rules": {
// Checks rules of Hooks
"react-hooks/rules-of-hooks": "error",
// Checks rules of Hooks
"react-hooks/exhaustive-deps": "warn",
// https://stackoverflow.com/questions/69928061/struggling-with-typescript-react-eslint-and-simple-arrow-functions-components
"react/function-component-definition": [
2,
{
"namedComponents": ["function-declaration", "arrow-function"]
}
],
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/anchor-is-valid.md#case-i-use-nextjs-and-im-getting-this-error-inside-of-links
"jsx-a11y/anchor-is-valid": 0,
// airbnb config configures stricter rules, change assert to "either".
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/issues/718
"jsx-a11y/label-has-associated-control": [
2,
{
"assert": "either"
}
],
// Since we do not use prop-types
"react/require-default-props": 0,
"semi": [2, "never"]
}
}