-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
103 lines (102 loc) · 2.38 KB
/
eslint.config.js
File metadata and controls
103 lines (102 loc) · 2.38 KB
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
import js from "@eslint/js"
import react from "eslint-plugin-react"
import reactHooks from "eslint-plugin-react-hooks"
import prettier from "eslint-plugin-prettier"
import * as parser from "@babel/eslint-parser"
export default [
{
ignores: [
"**/dist/**",
"**/build/**",
"tests/**",
"**/node_modules/**",
"**/.next/**",
"**/coverage/**",
"**/tmp/**",
"**/vendor/**",
"packages/*/dist/**",
"packages/*/build/**",
],
},
js.configs.recommended,
{
files: ["**/*.{js,jsx,ts,tsx}"],
plugins: { react, "react-hooks": reactHooks, prettier },
languageOptions: {
parser,
ecmaVersion: 2024,
sourceType: "module",
parserOptions: {
ecmaFeatures: {
jsx: true,
},
requireConfigFile: false,
babelOptions: {
presets: ["@babel/preset-react"],
},
},
globals: {
window: true,
document: true,
console: true,
fetch: true,
process: true,
setTimeout: true,
clearTimeout: true,
FormData: true,
history: true,
location: true,
addEventListener: true,
removeEventListener: true,
dispatchEvent: true,
Event: true,
performance: true,
MessageChannel: true,
AbortController: true,
queueMicrotask: true,
matchMedia: true,
__REACT_DEVTOOLS_GLOBAL_HOOK__: true,
reportError: true,
setImmediate: true,
},
},
settings: {
react: {
version: "detect",
"jsx-runtime": true,
},
},
rules: {
"prettier/prettier": "error",
"react/react-in-jsx-scope": "off",
"react/prop-types": "off",
"react/jsx-uses-vars": "error",
"react/jsx-uses-react": "error",
"no-unused-vars": [
"error",
{
varsIgnorePattern: "^_",
argsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
caughtErrors: "none",
},
],
"no-empty": ["error", { allowEmptyCatch: true }],
"no-case-declarations": "off",
},
},
{
files: ["**/*.cjs"],
languageOptions: {
sourceType: "commonjs",
globals: {
__dirname: true,
process: true,
console: true,
require: true,
module: true,
exports: true,
},
},
},
]