-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
eslint.config.js
73 lines (68 loc) · 2.03 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
64
65
66
67
68
69
70
71
72
73
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
import { basic, react } from '@ocavue/eslint-config'
import unocss from '@unocss/eslint-config/flat'
const configs = [
unocss,
...basic(),
...react().map((config) => ({
...config,
files: ['packages/react/**/*.@(mts|cts|ts|mtsx|ctsx|tsx)'],
})),
{
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unsafe-declaration-merging': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'import/no-extraneous-dependencies': process.env.CI ? 'error' : 'off',
},
},
{
files: [
'packages/dev/**/*.ts',
'playground/**/*.ts',
'playground/**/*.tsx',
],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/unbound-method': 'off',
'import/no-extraneous-dependencies': 'off',
},
},
{
rules: {
'no-console': ['warn', { allow: ['warn', 'error', 'assert'] }],
},
},
{
ignores: [
'**/_/**',
'**/.temp',
'**/.tsup',
'**/config-tsup.d.ts',
'**/vite.config.ts.timestamp*',
'**/tsup.config.bundled*',
],
},
]
// Enable EXPERIMENTAL_useProjectService
//
// See https://github.com/typescript-eslint/typescript-eslint/pull/6754
let projectServiceEnabled = false
for (const config of configs) {
if (config?.languageOptions?.parserOptions?.project) {
projectServiceEnabled = true
config.languageOptions.parserOptions.EXPERIMENTAL_useProjectService = {
// TODO: remove MAX_SAFE_INTEGER once the following is fixed
// https://github.com/typescript-eslint/typescript-eslint/issues/9032
maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING:
Number.MAX_SAFE_INTEGER,
}
}
}
if (!projectServiceEnabled) {
throw new Error('Unable to find any project service enabled config')
}
export default configs