-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config copy.js
More file actions
56 lines (55 loc) · 1.84 KB
/
eslint.config copy.js
File metadata and controls
56 lines (55 loc) · 1.84 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
import globals from "globals";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import react from "eslint-plugin-react";
import tseslint from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";
export default [
{
ignores: ["dist",
"node_modules",
"coverage",
],
},
{
files: ["**/*.{ts,tsx}"],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
parser: tsParser,
},
plugins: {
"@typescript-eslint": tseslint,
react,
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
},
settings: {
react: {
version: "detect",
},
},
rules: {
...reactHooks.configs.recommended.rules,
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
"react/no-unknown-property": "error", // Enforce camelCase for JSX attributes
'react/jsx-filename-extension': [1, { extensions: ['.tsx'] }],
'react/react-in-jsx-scope': 'off', // Vite takes care of importing React
'import/no-unresolved': 'off', // Defer to TS
'no-undef': 'off', // Defer to TS
'react/no-array-index-key': 'off', // TS can type-check array keys
'no-use-before-define': ['error', { functions: false }], // Allow function hoisting
'react/require-default-props': 'off', // TS performs strict null checking, not necessary.
'no-underscore-dangle': 'off', // Allow underscore in object keys
'no-new': 'off',
'no-nested-ternary': 'off',
'no-restricted-syntax': 'off', // We bundle all our code, so we don't need to worry about using newer JS syntax
'no-shadow': 'off',
'react-hooks/rules-of-hooks': 'error',
'@typescript-eslint/no-unused-vars': 'error',
},
},
];