-
Notifications
You must be signed in to change notification settings - Fork 110
/
eslint.config.mjs
77 lines (74 loc) · 1.87 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import eslint from '@eslint/js'
import eslintPluginReact from 'eslint-plugin-react'
import eslintPluginReactHooks from 'eslint-plugin-react-hooks'
import eslintPluginReactRefresh from 'eslint-plugin-react-refresh'
import eslintPluginUnicorn from 'eslint-plugin-unicorn'
import tseslint from 'typescript-eslint'
export default tseslint.config(
{
ignores: [
'vite.config.ts',
'tailwind.config.js',
'postcss.config.js',
'eslint.config.mjs',
'scripts/*',
'dist/*',
],
},
{
languageOptions: {
parserOptions: {
project: ['./tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
},
settings: {
react: {
version: 'detect',
},
},
},
eslint.configs.recommended,
...tseslint.configs.recommended,
...tseslint.configs.stylisticTypeChecked,
...tseslint.configs.strictTypeChecked,
eslintPluginReact.configs.flat.recommended,
{
plugins: {
'react-hooks': eslintPluginReactHooks,
},
rules: eslintPluginReactHooks.configs.recommended.rules,
},
eslintPluginUnicorn.configs['flat/recommended'],
{
// in main config for TSX/JSX source files
plugins: {
'react-refresh': eslintPluginReactRefresh,
},
rules: {},
},
{
rules: {
'no-console': [
'warn',
{
allow: ['error', 'warn'],
},
],
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-base-to-string': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'unicorn/prevent-abbreviations': 'off',
'unicorn/no-null': 'off',
'unicorn/no-nested-ternary': 'off',
'unicorn/filename-case': 'off',
'react/react-in-jsx-scope': 'off',
'react-refresh/only-export-components': [
'warn',
{
allowConstantExport: true,
},
],
},
},
)