-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy patheslint.config.mjs
More file actions
120 lines (112 loc) · 3 KB
/
Copy patheslint.config.mjs
File metadata and controls
120 lines (112 loc) · 3 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
import eslintContainerbase from '@containerbase/eslint-plugin';
import js from '@eslint/js';
import eslintConfigPrettier from 'eslint-config-prettier';
import { createTypeScriptImportResolver } from 'eslint-import-resolver-typescript';
import * as importX from 'eslint-plugin-import-x';
import pluginPromise from 'eslint-plugin-promise';
import globals from 'globals';
import * as tseslint from 'typescript-eslint';
import vitest from '@vitest/eslint-plugin';
import { defineConfig, globalIgnores } from 'eslint/config';
export default defineConfig(
globalIgnores([
'**/.git/',
'**/.vscode',
'**/node_modules/',
'**/dist/',
'**/coverage/',
'**/__fixtures__/**/*',
'**/__mocks__/**/*',
'**/*.d.ts',
'**/*.generated.ts',
'tools/dist',
'patches',
]),
{
linterOptions: {
reportUnusedDisableDirectives: 'error',
},
},
js.configs.recommended,
...tseslint.configs.recommendedTypeChecked.map((config) => ({
...config,
files: ['**/*.{ts,js,mjs,cjs}'],
})),
...tseslint.configs.stylisticTypeChecked.map((config) => ({
...config,
files: ['**/*.{ts,js,mjs,cjs}'],
})),
vitest.configs.recommended,
pluginPromise.configs['flat/recommended'],
eslintContainerbase.configs.all,
eslintConfigPrettier,
{
files: ['**/*.{ts,js,mjs,cjs}'],
extends: [importX.flatConfigs.recommended, importX.flatConfigs.typescript],
languageOptions: {
globals: {
...globals.node,
},
ecmaVersion: 'latest',
sourceType: 'module',
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
settings: {
'import-x/resolver-next': [createTypeScriptImportResolver()],
},
},
{
files: ['**/*.{ts,js,mjs,cjs}'],
rules: {
'import-x/no-extraneous-dependencies': [
'error',
{
devDependencies: [
'*.config.mjs',
'test/**',
'tools/**',
'__mocks__/**',
'**/*.test.ts',
],
},
],
'require-await': 'error',
'no-use-before-define': 0,
'no-restricted-syntax': 0,
'no-await-in-loop': 0,
'prefer-destructuring': 'off',
'prefer-template': 'off',
'no-underscore-dangle': 0,
'@typescript-eslint/camelcase': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/explicit-member-accessibility': 0,
'@typescript-eslint/explicit-function-return-type': 0,
// '@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-non-null-assertion': 0,
'@typescript-eslint/no-unused-vars': [
'error',
{
vars: 'all',
args: 'none',
ignoreRestSiblings: false,
},
],
// TODO: fixme
'@typescript-eslint/prefer-nullish-coalescing': 0,
},
},
{
files: ['**/*.test.ts'],
languageOptions: {
globals: {
...globals.vitest,
},
},
rules: {
'vitest/expect-expect': 0,
},
},
);