-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
53 lines (51 loc) · 1.5 KB
/
eslint.config.js
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
import js from '@eslint/js';
import globals from 'globals';
import eslintReact from 'eslint-plugin-react';
import eslintReactHooks from 'eslint-plugin-react-hooks';
import eslintReactRefresh from 'eslint-plugin-react-refresh';
/** @type {import('eslint').Linter.Config[]} */
export default [
{ ignores: ['node_modules', 'dist'] },
js.configs.recommended,
{
languageOptions: {
ecmaVersion: 2021,
globals: {
...globals.browser,
...globals.node,
...globals.es2021
},
parserOptions: eslintReact.configs.recommended.parserOptions
},
files: ['**/*.{js,jsx,ts,tsx}'],
settings: { react: { version: '18.3' } },
plugins: {
react: eslintReact,
'react-hooks': eslintReactHooks,
'react-refresh': eslintReactRefresh
},
rules: {
...js.configs.recommended.rules,
...eslintReact.configs.recommended.rules,
...eslintReact.configs['jsx-runtime'].rules,
...eslintReactHooks.configs.recommended.rules,
"semi": ["error", "always"],
"comma-dangle": ["error", "never"],
"react/jsx-no-target-blank": [
"error", {
"allowReferrer": false,
"enforceDynamicLinks": 'always',
"warnOnSpreadAttributes": false,
"links": true,
"forms": true
}
],
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true }
],
'react/prop-types': [0],
indent: ['error', 2, { 'SwitchCase': 1 }]
}
}
];