-
-
Notifications
You must be signed in to change notification settings - Fork 194
/
Copy patheslint.config.mjs
62 lines (61 loc) · 1.88 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
50
51
52
53
54
55
56
57
58
59
60
61
62
import eslint from "@eslint/js";
import tseslint from 'typescript-eslint';
import reactPlugin from 'eslint-plugin-react';
import reactRefresh from "eslint-plugin-react-refresh";
import globals from "globals";
import eslintConfigPrettier from "eslint-config-prettier";
export default tseslint.config(
eslint.configs.recommended,
tseslint.configs.recommended,
// tseslint.configs.recommendedTypeChecked, // Add type checks.
{
languageOptions: {
globals: {
...globals.serviceworker,
...globals.browser,
},
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{
files: ['**/*.js'],
extends: [tseslint.configs.disableTypeChecked],
},
{
rules: {
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'no-case-declarations': 'off',
'no-prototype-builtins': 'off',
},
},
reactPlugin.configs.flat.recommended,
reactPlugin.configs.flat['jsx-runtime'],
{
settings: {
react: {
version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use
},
},
rules: {
'react/no-deprecated': 'warn',
'react/prop-types': 'off',
},
},
{
files: ['**/*.{jsx,tsx}'],
plugins: {
"react-refresh": reactRefresh,
},
rules: {
'react-refresh/only-export-components': 'warn',
},
},
eslintConfigPrettier, // Avoid conflict with prettier.
);