-
Notifications
You must be signed in to change notification settings - Fork 1
/
eslint.config.cjs
48 lines (44 loc) · 1.21 KB
/
eslint.config.cjs
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
const eslint = require('@eslint/js')
const globals = require('globals')
const tseslint = require('typescript-eslint')
const rulesConfig = [
{
rules: {
'no-unused-vars': [
'error',
{
'vars': 'all',
'args': 'after-used',
'ignoreRestSiblings': true,
'varsIgnorePattern': '^_', // Ignore variables that start with _
'argsIgnorePattern': '^_' // Ignore arguments that start with _
}
],
'no-undef': 'warn',
'prefer-arrow-callback': ['error', { allowNamedFunctions: false }],
'func-style': ['error', 'expression', { allowArrowFunctions: true }],
'no-unused-expressions': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
},
},
]
const ignoresConfig = [{ ignores: ['dist', 'bin', 'eslint.config.cjs', 'coverage'] }]
module.exports = [
{
files: ['**/*.ts', '**/*.test.ts', '**/*.spec.ts'],
languageOptions: {
globals: {
...globals.node,
...globals.mocha,
},
parserOptions: {
projectService: true,
tsconfigRootDir: __dirname,
},
},
},
eslint.configs.recommended,
...tseslint.configs.recommended,
...rulesConfig,
...ignoresConfig,
]