-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
49 lines (48 loc) · 1.28 KB
/
eslint.config.mjs
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
import tsPlugin from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";
import reactPlugin from "eslint-plugin-react";
export default [
{
files: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"],
languageOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
plugins: {
react: reactPlugin,
"@typescript-eslint": tsPlugin,
},
rules: {
"react/jsx-uses-react": "off", // React 17+ doesn't require React import
"react/react-in-jsx-scope": "off", // React 17+ doesn't require React in scope
"react/prop-types": "off", // PropTypes are unnecessary with TypeScript
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
"no-console": "warn",
"no-debugger": "warn",
},
settings: {
react: {
version: "detect",
},
},
},
{
files: ["**/*.ts", "**/*.tsx"],
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaVersion: "2020",
sourceType: "module",
ecmaFeatures: {
jsx: true,
},
},
},
},
{
files: ["**/__tests__/**/*.{js,ts,tsx}", "**/*.{spec,test}.{js,ts,tsx}"],
rules: {
"no-console": "off", // Allow console logs in test files
},
},
];