-
Notifications
You must be signed in to change notification settings - Fork 31
/
eslint.config.js
42 lines (41 loc) · 1.37 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
import js from '@eslint/js';
import pluginPrettier from 'eslint-plugin-prettier/recommended';
import pluginReact from 'eslint-plugin-react';
import pluginReactHooks from 'eslint-plugin-react-hooks';
import pluginReactRefresh from 'eslint-plugin-react-refresh';
import pluginSimpleImport from 'eslint-plugin-simple-import-sort';
import globals from 'globals';
export default [
{ ignores: ['**/node_modules', '**/dist', '**/build'] },
{
files: ['**/*.{js,jsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
parserOptions: {
ecmaVersion: 'latest',
ecmaFeatures: { jsx: true },
sourceType: 'module',
},
},
settings: { react: { version: 'detect' } },
plugins: {
react: pluginReact,
'react-hooks': pluginReactHooks,
'react-refresh': pluginReactRefresh,
'simple-import-sort': pluginSimpleImport,
},
rules: {
...js.configs.recommended.rules,
...pluginReact.configs.recommended.rules,
...pluginReact.configs['jsx-runtime'].rules,
...pluginReactHooks.configs.recommended.rules,
'react/jsx-no-target-blank': 'off',
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'react/prop-types': 'off',
},
},
pluginPrettier,
];