-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy patheslint.config.mjs
131 lines (123 loc) · 3.22 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
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
121
122
123
124
125
126
127
128
129
130
131
/* eslint-disable import/no-named-as-default-member */
import eslintContainerbase from '@containerbase/eslint-plugin';
import js from '@eslint/js';
import eslintConfigPrettier from 'eslint-config-prettier';
import eslintPluginImport from 'eslint-plugin-import';
import pluginPromise from 'eslint-plugin-promise';
import globals from 'globals';
import tseslint from 'typescript-eslint';
import eslintJestPlugin from 'eslint-plugin-jest';
export default tseslint.config(
{
ignores: [
'**/.git/',
'**/.vscode',
'**/node_modules/',
'**/dist/',
'**/coverage/',
'**/__fixtures__/**/*',
'**/__mocks__/**/*',
'**/*.d.ts',
'**/*.generated.ts',
'tools/dist',
'patches',
],
},
{
linterOptions: {
reportUnusedDisableDirectives: true,
},
},
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}'],
})),
eslintPluginImport.flatConfigs.errors,
eslintPluginImport.flatConfigs.warnings,
eslintPluginImport.flatConfigs.recommended,
eslintPluginImport.flatConfigs.typescript,
eslintJestPlugin.configs['flat/recommended'],
eslintJestPlugin.configs['flat/style'],
pluginPromise.configs['flat/recommended'],
eslintContainerbase.configs.all,
eslintConfigPrettier,
{
files: ['**/*.{ts,js,mjs,cjs}'],
languageOptions: {
globals: {
...globals.node,
},
ecmaVersion: 'latest',
sourceType: 'module',
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
settings: {
'import/resolver': {
typescript: {
alwaysTryTypes: true,
project: ['tsconfig.lint.json', 'tools/jsconfig.json'],
},
},
},
},
{
files: ['**/*.{ts,js,mjs,cjs}'],
rules: {
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: [
'eslint.config.mjs',
'test/**',
'tools/**',
'jest.config.js',
'__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.jest,
},
},
rules: {
'jest/expect-expect': 0,
},
},
);