-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.mjs
91 lines (87 loc) · 2.41 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
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: ['**/dist/**/*', 'esbuild.mjs', 'eslint.config.mjs', 'ucsc/*'],
},
{
languageOptions: {
parserOptions: {
project: ['./tsconfig.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-empty': 'off',
'no-console': [
'warn',
{
allow: ['error', 'warn'],
},
],
'no-underscore-dangle': 'off',
curly: 'error',
semi: ['error', 'never'],
'spaced-comment': [
'error',
'always',
{
markers: ['/'],
},
],
'unicorn/no-null': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'unicorn/no-useless-undefined': 'off',
'unicorn/catch-error-name': 'off',
'unicorn/filename-case': 'off',
'unicorn/prevent-abbreviations': 'off',
'react-refresh/only-export-components': 'warn',
'react/no-unescaped-entities': 'off',
'react/prop-types': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
ignoreRestSiblings: true,
caughtErrors: 'none',
},
],
},
},
)