-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy patheslint.config.mjs
64 lines (63 loc) · 1.86 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
import stylistic from '@stylistic/eslint-plugin'
import typescriptEslint from '@typescript-eslint/eslint-plugin'
import parserTs from '@typescript-eslint/parser'
import prettierRecommended from 'eslint-plugin-prettier/recommended'
import reactEslint from 'eslint-plugin-react'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
export default [
prettierRecommended,
{
plugins: {
'@stylistic': stylistic,
'@stylistic/ts': stylistic,
'@typescript-eslint': typescriptEslint,
'react-refresh': reactRefresh,
'react-hooks': reactHooks,
react: reactEslint,
},
languageOptions: {
parser: parserTs,
},
files: ['src/**/*.{js,mjs,cjs,ts,mts,jsx,tsx}'],
rules: {
'react-refresh/only-export-components': ['error', { allowConstantExport: true }],
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],
'no-console': ['warn', { allow: ['info', 'warn', 'error'] }],
eqeqeq: 'error',
'@stylistic/ts/padding-line-between-statements': [
'error',
{ blankLine: 'always', prev: ['const', 'let', 'var'], next: '*' },
{
blankLine: 'any',
prev: ['const', 'let', 'var'],
next: ['const', 'let', 'var'],
},
{ blankLine: 'always', prev: '*', next: ['interface', 'type'] },
],
'@stylistic/jsx-self-closing-comp': [
'error',
{
component: true,
html: true,
},
],
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'error',
'react/jsx-key': 'error',
'prettier/prettier': [
'error',
{
endOfLine: 'auto',
},
],
},
},
]