-
Notifications
You must be signed in to change notification settings - Fork 107
/
eslint.config.mjs
43 lines (41 loc) · 1.21 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
// @ts-check
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
{
ignores: [
'.azure-pipelines/',
'.vscode-test/',
'dist/',
'out/',
],
},
{
languageOptions: {
parserOptions: {
projectService: {
allowDefaultProject: ['*.?(m)js'],
},
tsconfigRootDir: import.meta.dirname,
}
},
rules: {
// Allow numbers and booleans in template expressions
'@typescript-eslint/restrict-template-expressions': ['error', {
allowNumber: true,
allowBoolean: true,
}],
// Always use `return await` in async functions
'@typescript-eslint/return-await': ['error', 'always'],
// Prefer using String.match
'@typescript-eslint/prefer-regexp-exec': 'off',
},
},
{
files: ['**/*.?(m)js'],
extends: [tseslint.configs.disableTypeChecked],
},
);