-
-
Notifications
You must be signed in to change notification settings - Fork 29
/
.eslintrc.cjs
87 lines (86 loc) · 2.24 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
75
76
77
78
79
80
81
82
83
84
85
86
87
/* eslint-env node */
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
require("@rushstack/eslint-patch/modern-module-resolution");
module.exports = {
root: true,
extends: [
"plugin:vitest-globals/recommended",
"eslint:recommended",
"plugin:react/recommended",
"plugin:jsx-a11y/recommended",
"plugin:react-hooks/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"prettier",
],
settings: {
react: {
version: "detect",
},
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"],
},
"import/resolver": {
typescript: {
alwaysTryTypes: true,
},
},
},
env: {
browser: true,
es2022: true,
es6: true,
"vitest-globals/env": true,
"cypress/globals": true,
},
overrides: [
{
files: ["cypress/e2e/**.{cy,spec}.{js,ts,jsx,tsx}"],
extends: ["plugin:cypress/recommended"],
},
{
files: ["*.tsx, *.jsx"],
rules: {
"@typescript-eslint/ban-types": [
"error",
{
extendDefaults: true,
types: {
"{}": false,
},
},
],
"no-unused-expressions": "off",
},
},
{
files: ["*.ts", "*.tsx"],
rules: {
"no-undef": "off",
"@typescript-eslint/no-misused-promises": "off",
},
},
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: "latest",
sourceType: "module",
project: "tsconfig.json",
},
plugins: ["react", "import", "jsx-a11y", "@typescript-eslint", "cypress"],
rules: {
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-unused-vars": "off",
"no-undef": process.env.NODE_ENV === "production" ? "warn" : "error",
"no-unreachable": process.env.NODE_ENV === "production" ? "warn" : "error",
"react/react-in-jsx-scope": "off",
"@typescript-eslint/no-unused-vars":
process.env.NODE_ENV === "production" ? "warn" : "error",
"react/prop-types": 0,
"@typescript-eslint/no-empty-function": 0,
},
};