-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
64 lines (63 loc) · 1.45 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
63
64
import js from '@eslint/js'
import globals from 'globals'
import tseslint from 'typescript-eslint'
import eslintReact from 'eslint-plugin-react'
import eslintReactHooks from 'eslint-plugin-react-hooks'
import eslintReactRefresh from 'eslint-plugin-react-refresh'
import prettierPlugin from 'eslint-plugin-prettier'
import eslintConfigPrettier from 'eslint-config-prettier'
/** @type {import('eslint').Linter.FlatConfig[]} */
export default tseslint.config(
js.configs.recommended,
...tseslint.configs.recommended,
{
plugins: {
'@typescript-eslint': tseslint.plugin,
react: eslintReact,
'react-hooks': eslintReactHooks,
'react-refresh': eslintReactRefresh,
prettier: prettierPlugin,
},
},
{
ignores: ['dist', 'node_modules', 'coverage', 'eslint.config.js'],
},
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
...globals.es2020,
},
parserOptions: {
project: ['tsconfig.json', 'tsconfig.node.json'],
},
},
},
{
rules: {
...prettierPlugin.configs.recommended.rules,
...eslintConfigPrettier.rules,
},
},
{
files: ['**/*.{js,jsx,ts,tsx}'],
rules: {
'no-mixed-spaces-and-tabs': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
'prettier/prettier': [
'off',
{
useTabs: true,
singleQuote: true,
semi: false,
},
],
},
}
)