-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
71 lines (66 loc) · 1.67 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
import eslint from '@eslint/js'
import stylistic from '@stylistic/eslint-plugin'
import promisePlugin from 'eslint-plugin-promise'
import reactPlugin from 'eslint-plugin-react'
import globals from 'globals'
import tseslint from 'typescript-eslint'
export default [
...tseslint.config(
{
ignores: ['**/node_modules/*', '**/dist/'] // global ignore with single ignore key
},
// all projects:
eslint.configs.recommended,
...tseslint.configs.recommended,
stylistic.configs.customize({
braceStyle: '1tbs',
commaDangle: 'never',
indent: 'tab',
jsx: true,
quotes: 'single',
semi: false
}),
{
plugins: {
promise: promisePlugin,
react: reactPlugin
},
languageOptions: {
ecmaVersion: 2023,
globals: {
...globals.browser,
...globals.node,
...globals.es2023
}
},
rules: {
...promisePlugin.configs.recommended.rules,
...reactPlugin.configs.recommended.rules,
...reactPlugin.configs['jsx-runtime'].rules,
// custom rules here
'promise/always-return': ['error', { ignoreLastCallback: true }],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': ['error', {
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_'
}]
},
settings: {
react: {
version: 'detect' // You can add this if you get a warning about the React version when you lint
}
}
},
{
files: ['**/*.test.ts', '**/*.test.tsx', '**/*.test.mts', '**/*.test.cts', '**/*.test.js'],
plugins: {
'@stylistic': stylistic
},
rules: {
'@stylistic/max-statements-per-line': 'off'
}
}
)
]