-
Notifications
You must be signed in to change notification settings - Fork 3
/
eslint.config.mjs
44 lines (43 loc) · 1.2 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
import globals from 'globals'
import pluginJs from '@eslint/js'
import tsEslint from 'typescript-eslint'
import pluginPrettier from 'eslint-plugin-prettier'
import pluginReact from 'eslint-plugin-react'
import pluginReactHooks from 'eslint-plugin-react-hooks'
export default [
...tsEslint.configs.recommended,
{
files: ['src/**/*.{js,jsx,ts,tsx}'],
languageOptions: {
globals: globals.browser,
parserOptions: {
ecmaVersion: 'latest',
ecmaFeatures: { jsx: true },
sourceType: 'module',
},
},
plugins: {
js: pluginJs,
prettier: pluginPrettier,
react: pluginReact,
'react-hooks': pluginReactHooks,
},
rules: {
...pluginJs.configs.recommended.rules,
...pluginReact.configs.flat.recommended.rules,
...pluginReact.configs['jsx-runtime'].rules,
...pluginReactHooks.configs.recommended.rules,
'prettier/prettier': 'error',
'no-console': 'warn',
'no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
'react/jsx-uses-vars': 'warn',
},
settings: {
react: {
version: 'detect',
},
},
},
]