-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.cjs
67 lines (67 loc) · 1.46 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
// .eslintrc.cjs
module.exports = {
root: true,
env: {
browser: true,
es2021: true,
jest: true,
},
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended",
"plugin:react/recommended",
"plugin:import/typescript",
"plugin:prettier/recommended",
],
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 12,
sourceType: "module",
project: "./tsconfig.json",
},
plugins: [
"react",
"@typescript-eslint",
"react-hooks",
"prettier",
"react-refresh",
],
overrides: [
{
files: ["__mocks__/**/*.js"],
rules: {
"no-undef": "off", // Turn off the 'no-undef' rule
},
env: {
commonjs: true, // Set environment to CommonJS
},
},
],
rules: {
"react/prop-types": "off",
"react/react-in-jsx-scope": "off", // React 17+ doesn't require React to be in scope when using JSX
"prettier/prettier": ["error", { endOfLine: "auto" }],
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
"@typescript-eslint/no-explicit-any": "off",
// Add any other custom rules or overrides here
},
settings: {
react: {
version: "detect", // Automatically detect the React version
},
},
ignorePatterns: [
"dist",
"node_modules",
"jest.config.cjs",
".eslintrc.cjs",
"__mocks__",
"vitest.config.ts",
],
};