-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
65 lines (59 loc) · 1.35 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
import tseslint from 'typescript-eslint'
import eslint from '@eslint/js'
import promisePlugin from 'eslint-plugin-promise'
import stylistic from '@stylistic/eslint-plugin'
import nodePlugin from 'eslint-plugin-n'
import globals from 'globals'
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
},
languageOptions: {
ecmaVersion: 2023,
globals: {
...globals.node,
...globals.es2023
}
},
rules: {
...promisePlugin.configs.recommended.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: '^_'
}]
}
},
{
// node rules
files: ['**/*.ts'],
// files: [],
plugins: {
n: nodePlugin
},
rules: {
...nodePlugin.configs['flat/recommended'].rules
}
}
)
]