-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
74 lines (74 loc) · 2.06 KB
/
.eslintrc.cjs
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
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaFeatures: { jsx: true },
sourceType: "module",
ecmaVersion: 6,
project: "./tsconfig.eslint.json",
},
plugins: ["@typescript-eslint", "prettier"],
env: {
browser: true,
node: true,
},
extends: [
"next/core-web-vitals",
"airbnb",
"airbnb-typescript",
"plugin:react/recommended",
"plugin:import/typescript",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
],
rules: {
"prettier/prettier": "error",
"import/no-extraneous-dependencies": ["error", { devDependencies: true }],
"react/prop-types": "off",
"react/function-component-definition": "off",
"react/jsx-one-expression-per-line": ["error", { allow: "single-child" }],
// "react/no-unstable-nested-components": ["error", { allowAsProps: true }],
"arrow-body-style": ["error", "always"],
"react/react-in-jsx-scope": "off",
"react/no-unknown-property": [1, { ignore: ["as"] }],
"no-console": ["warn", { allow: ["warn", "error"] }],
"no-underscore-dangle": "off",
"import/prefer-default-export": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "error",
"react/require-default-props": "off",
"react/jsx-sort-props": [
"error",
{ callbacksLast: true, shorthandLast: true, reservedFirst: true },
],
"jsx-a11y/anchor-is-valid": [
"error",
{
components: ["NextLink"],
specialLink: ["href"],
},
],
},
overrides: [
{
// enable the rule specifically for TypeScript files
files: ["**/*.ts", "**/*.tsx"],
rules: {
"react/jsx-props-no-spreading": "off",
},
},
{
// enable the rule specifically for TypeScript files
files: ["**/*.js", "**/*.jsx"],
rules: {
"@typescript-eslint/no-var-requires": "off",
},
},
],
settings: {
react: {
version: "detect",
},
},
};