-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy patheslint.config.js
63 lines (63 loc) · 1.59 KB
/
eslint.config.js
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
61
62
63
const eslint = require('@eslint/js');
const eslintConfigPrettier = require('eslint-config-prettier');
const jest = require('eslint-plugin-jest');
const tsdoc = require('eslint-plugin-tsdoc');
const globals = require('globals');
const tseslint = require('typescript-eslint');
module.exports = tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked.map((c) => ({
...c,
files: ['**/*.ts'],
})),
...tseslint.configs.stylisticTypeChecked.map((c) => ({
...c,
files: ['**/*.ts'],
})),
eslintConfigPrettier,
{
ignores: ['coverage/', 'docs/', 'dist/', 'node_modules/'],
},
{
languageOptions: {
ecmaVersion: 2018,
sourceType: 'commonjs',
globals: globals.node,
parserOptions: {
project: true,
tsconfigRootDir: __dirname,
},
},
},
{
files: ['tests/**/*.{js,ts}'],
...jest.configs['flat/recommended'],
rules: {
...jest.configs['flat/style'].rules,
...jest.configs['flat/recommended'].rules,
'@typescript-eslint/ban-ts-comment': [
'error',
{
'ts-expect-error': 'allow-with-description',
},
],
'@typescript-eslint/dot-notation': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/unbound-method': 'off',
'jest/expect-expect': [
'warn',
{
assertFunctionNames: ['expect*'],
},
],
},
},
{
files: ['**/*.ts'],
plugins: { tsdoc },
rules: {
'tsdoc/syntax': 'error',
},
},
);