-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy patheslint.config.js
62 lines (61 loc) · 1.78 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
54
55
56
57
58
59
60
61
62
import js from '@eslint/js'
import globals from 'globals'
import pluginReactHooks from 'eslint-plugin-react-hooks'
import pluginReactRefresh from 'eslint-plugin-react-refresh'
import pluginImport from 'eslint-plugin-import'
import pluginReact from 'eslint-plugin-react'
import tsEslint, { configs } from 'typescript-eslint'
import pluginPrettier from 'eslint-plugin-prettier/recommended'
export default tsEslint.config(
{ ignores: ['docs'] },
{
extends: [
js.configs.recommended,
...configs.recommended,
pluginImport.flatConfigs.recommended,
pluginImport.flatConfigs.typescript,
pluginReact.configs.flat.recommended,
pluginPrettier,
],
files: ['**/*.{ts,tsx,js,jsx,mjs,cjs}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
'react-hooks': pluginReactHooks,
'react-refresh': pluginReactRefresh,
},
rules: {
...pluginReactHooks.configs.recommended.rules,
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object', 'type'],
},
],
'@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true }],
'prefer-template': 'warn',
'no-console': 'warn',
'react/prop-types': 'off',
'react/react-in-jsx-scope': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
'@typescript-eslint/no-empty-object-type': [
'error',
{
allowWithName: 'Props$',
},
],
},
settings: {
react: {
version: 'detect',
},
'import/resolver': {
typescript: true,
node: true,
},
},
},
)