-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy patheslint.config.js
61 lines (59 loc) · 1.74 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
const { FlatCompat } = require('@eslint/eslintrc');
const tseslint = require('@typescript-eslint/eslint-plugin');
const tsparser = require('@typescript-eslint/parser');
const prettier = require('eslint-config-prettier');
const path = require('node:path');
// Create a compatibility instance
const compat = new FlatCompat({
baseDirectory: __dirname,
});
module.exports = [
require('@eslint/js').configs.recommended,
...compat.extends('plugin:@typescript-eslint/recommended'),
{
files: ['**/*.ts', '!**/*.test.ts'],
languageOptions: {
parser: tsparser,
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: './tsconfig.json',
tsconfigRootDir: __dirname,
},
},
plugins: {
'@typescript-eslint': tseslint,
},
rules: {
'@typescript-eslint/explicit-function-return-type': 'warn',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/ban-ts-comment': 'warn',
},
},
{
files: ['**/*.test.ts'],
languageOptions: {
parser: tsparser,
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: './tsconfig.test.json',
tsconfigRootDir: __dirname,
},
},
plugins: {
'@typescript-eslint': tseslint,
},
rules: {
'@typescript-eslint/explicit-function-return-type': 'warn',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/ban-ts-comment': 'warn',
},
},
{
ignores: ['dist/**', 'coverage/**', 'node_modules/**', '**/*.js', '**/*.d.ts'],
},
prettier,
];