-
Notifications
You must be signed in to change notification settings - Fork 155
/
eslint.config.mjs
51 lines (49 loc) · 1.54 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
// @ts-check
import eslint from '@eslint/js';
import ts from 'typescript-eslint';
import mocha from 'eslint-plugin-mocha';
export default ts.config(
eslint.configs.recommended,
...ts.configs.strictTypeChecked,
{
files: ['*.ts'],
languageOptions: {
parserOptions: {
projectService: true,
project: './tsconfig.json',
tsconfigRootDir: import.meta.dirname,
},
},
},
{
files: ['*.ts', '*.mjs'],
rules: {
eqeqeq: ['error', 'always'],
'@typescript-eslint/no-unnecessary-condition': ['error', { allowConstantLoopConditions: true }],
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
},
},
mocha.configs.flat.recommended,
{
files: ['test.ts'],
rules: {
'@typescript-eslint/unbound-method': 'off', // For checking `window.runActionlint`
'mocha/no-exclusive-tests': 'error',
'mocha/no-pending-tests': 'error',
'mocha/no-skipped-tests': 'error',
'mocha/no-top-level-hooks': 'error',
},
},
{
files: ['eslint.config.mjs'],
languageOptions: {
parserOptions: {
projectService: false,
project: 'tsconfig.eslint.json',
},
},
}
);