-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheslint.config.mjs
126 lines (119 loc) · 3.25 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
import eslint from '@eslint/js'
import importPlugin from 'eslint-plugin-import'
import eslintPluginReact from 'eslint-plugin-react'
import eslintPluginReactHooks from 'eslint-plugin-react-hooks'
import eslintPluginUnicorn from 'eslint-plugin-unicorn'
import tseslint from 'typescript-eslint'
export default tseslint.config(
{
ignores: [
'**/build/',
'**/dist/',
'**/.storybook/',
'**/node_modules/',
'**/lib/',
'**/app/vite.config.ts',
],
},
{
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,
importPlugin.flatConfigs.recommended,
eslintPluginReact.configs.flat.recommended,
{
plugins: {
'react-hooks': eslintPluginReactHooks,
},
rules: eslintPluginReactHooks.configs.recommended.rules,
},
eslintPluginUnicorn.configs['flat/recommended'],
{
rules: {
'no-console': [
'error',
{
allow: ['warn', 'error'],
},
],
'unicorn/prevent-abbreviations': 'off',
'unicorn/no-null': 'off',
'unicorn/filename-case': 'off',
'unicorn/prefer-node-protocol': 'off',
'unicorn/numeric-separators-style': 'off',
'unicorn/no-nested-ternary': 'off',
'unicorn/prefer-global-this': 'off',
'react/prop-types': 'off',
'react/react-in-jsx-scope': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-base-to-string': 'off',
'@typescript-eslint/restrict-plus-operands': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'spaced-comment': [
'error',
'always',
{
markers: ['/'],
},
],
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
ignoreRestSiblings: true,
},
],
curly: 'error',
'import/no-unresolved': 'off',
'import/order': [
'error',
{
named: true,
'newlines-between': 'always',
alphabetize: {
order: 'asc',
},
groups: [
'builtin',
['external', 'internal'],
['parent', 'sibling', 'index', 'object'],
'type',
],
pathGroups: [
{
group: 'builtin',
pattern: 'react',
position: 'before',
},
{
group: 'external',
pattern: '@mui/icons-material',
position: 'after',
},
],
pathGroupsExcludedImportTypes: ['react'],
},
],
},
},
)