-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy patheslint.config.mjs
60 lines (58 loc) · 1.75 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
// @ts-check
import eslint from '@eslint/js';
import ts from 'typescript-eslint';
import mocha from 'eslint-plugin-mocha';
import configPrettier from 'eslint-config-prettier';
import n from 'eslint-plugin-n';
import security from 'eslint-plugin-security';
export default ts.config(
eslint.configs.recommended,
...ts.configs.recommendedTypeChecked,
n.configs['flat/recommended-module'],
security.configs.recommended,
configPrettier,
{
ignores: ['*.d.ts'],
},
{
files: ['*.ts'],
languageOptions: {
parserOptions: {
project: 'tsconfig.json',
},
},
},
{
files: ['*.ts', 'eslint.config.mjs'],
rules: {
indent: ['error', 4],
quotes: ['error', 'single'],
'linebreak-style': ['error', 'unix'],
semi: ['error', 'always'],
eqeqeq: ['error', 'always'],
'no-constant-condition': ['error', { checkLoops: false }],
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'n/no-missing-import': 'off', // This rule causes false positives on type-only packages
},
},
{
files: ['eslint.config.mjs'],
languageOptions: {
parserOptions: {
project: 'tsconfig.eslint.json',
},
},
},
mocha.configs.flat.recommended,
{
files: ['test.ts'],
rules: {
'mocha/no-exclusive-tests': 'error',
'mocha/no-pending-tests': 'error',
'mocha/no-skipped-tests': 'error',
'mocha/no-top-level-hooks': 'error',
},
}
);