-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy patheslint.config.mjs
46 lines (44 loc) · 1.23 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
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import eslintPluginUnicorn from 'eslint-plugin-unicorn';
import globals from 'globals';
const files = ['js/**/src/**/*.ts', 'js/test/*.ts'];
export default [
{
ignores: ['js/cli/build/**', '.yarn/**', '**/lib/**', 'js/test/demo/**'],
},
...[eslint.configs.recommended, ...tseslint.configs.recommended, eslintPluginUnicorn.configs['flat/recommended']].map(
(config) => ({
...config,
files,
}),
),
{
files,
rules: {
'@typescript-eslint/no-unused-vars': [
'error',
{
args: 'all',
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
ignoreRestSiblings: true,
},
],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-object-type': ['error', { allowInterfaces: 'with-single-extends' }],
'prefer-rest-params': 'off',
'unicorn/prevent-abbreviations': 'off',
'unicorn/no-null': 'off',
},
languageOptions: {
globals: {
...globals.browser,
...globals.es2020,
...globals.node,
},
},
},
];