-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheslint.config.mjs
76 lines (67 loc) · 2.08 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// @ts-check
import js from '@eslint/js';
import tseslint from 'typescript-eslint';
import * as pluginImport from 'eslint-plugin-import';
/** @type {Array<import("typescript-eslint").ConfigWithExtends>} */
export const globalIgnore = [
{
ignores: ['**/*.d.ts', '**/*.test.ts'],
},
];
/** @type {Array<import("typescript-eslint").ConfigWithExtends>} */
export const jsLintConfigs = [
js.configs.recommended,
{
files: ['**/*.js'],
languageOptions: {
ecmaVersion: 2018,
sourceType: 'module',
},
},
{
files: ['**/*.mts', '**/*.ts', '**/*.tsx'],
extends: [...tseslint.configs.recommendedTypeChecked, pluginImport.flatConfigs?.recommended],
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
settings: {
'import/resolver': {
// You will also need to install and configure the TypeScript resolver
// See also https://github.com/import-js/eslint-import-resolver-typescript#configuration
typescript: true,
node: true,
},
},
rules: {
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/prefer-for-of': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],
'@typescript-eslint/no-redundant-type-constituents': 'off',
'@typescript-eslint/require-await': 'off',
'@typescript-eslint/consistent-type-definitions': 'off',
'@typescript-eslint/dot-notation': 'off',
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-misused-promises': [
'error',
{
checksVoidReturn: false,
},
],
'import/no-duplicates': 'off',
},
},
];
export default tseslint.config(...globalIgnore, ...jsLintConfigs);