-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy patheslint.config.js
More file actions
99 lines (98 loc) · 2.76 KB
/
eslint.config.js
File metadata and controls
99 lines (98 loc) · 2.76 KB
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
// @ts-check
import eslint from '@eslint/js'
import tseslint from 'typescript-eslint'
import nextPlugin from '@next/eslint-plugin-next'
import reactPlugin from 'eslint-plugin-react'
import hooksPlugin from 'eslint-plugin-react-hooks'
import * as importPlugin from 'eslint-plugin-import'
import { fixupPluginRules } from '@eslint/compat'
export default tseslint.config(
{
ignores: ['.yarn/', 'dist/'],
},
eslint.configs.recommended,
...tseslint.configs.recommended,
{
files: ['**/*.ts', '**/*.tsx'],
plugins: {
react: reactPlugin,
// @ts-ignore-next-line
'react-hooks': fixupPluginRules(hooksPlugin),
// @ts-ignore-next-line
'@next/next': fixupPluginRules(nextPlugin),
import: importPlugin,
},
// @ts-ignore-next-line
rules: {
...reactPlugin.configs['jsx-runtime'].rules,
...hooksPlugin.configs.recommended.rules,
...nextPlugin.configs.recommended.rules,
...nextPlugin.configs['core-web-vitals'].rules,
'import/order': [
'warn',
{
groups: [
['external', 'builtin', 'internal'],
'parent',
'sibling',
'index',
'object',
],
'newlines-between': 'always',
alphabetize: { order: 'asc', caseInsensitive: true },
},
],
},
},
{
rules: {
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unnecessary-type-constraint': 'off',
'prefer-const': 'off',
'no-var': 'off',
'no-irregular-whitespace': 'off',
'@typescript-eslint/ban-types': 'off',
'no-extra-boolean-cast': 'off',
'no-unsafe-optional-chaining': 'off',
'no-empty': 'off',
'no-undef': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-non-null-asserted-optional-chain': 'off',
'no-empty-pattern': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'no-useless-escape': 'off',
},
},
{
rules: {
'no-restricted-imports': [
'error',
{
paths: [
{
name: '@material-ui/core',
message: 'no named import from material ui core',
},
{
name: '@material-ui/lab',
message: 'no named import from material ui lab',
},
{
name: '@mui/material',
message: 'no named import from mui material',
},
{
name: '@mui/lab',
message: 'no named import from mui lab',
},
{
name: '@mui/system',
message: 'no named import from mui system',
},
],
},
],
},
},
)