Skip to content

Commit e31c9f6

Browse files
committed
fix: typecheck error
1 parent ae67845 commit e31c9f6

File tree

3 files changed

+70
-12
lines changed

3 files changed

+70
-12
lines changed

.gitignore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ node_modules/
3939
jspm_packages/
4040

4141
# TypeScript v1 declaration files
42-
typings/
42+
# typings/
4343

4444
# Optional npm cache directory
4545
.npm
@@ -77,4 +77,8 @@ dist
7777
# IDE
7878
.idea
7979

80-
*.lerna_backup
80+
*.lerna_backup
81+
_fixtures
82+
83+
.temp
84+
.history

src/configs/vue.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,11 @@ export async function vue(
1111
): Promise<FlatConfigItem[]> {
1212
const { files = [GLOB_VUE] } = options
1313

14-
type VueConfigKey =
15-
| 'base'
16-
| 'essential'
17-
| 'no-layout-rules'
18-
| 'recommended'
19-
| 'strongly-recommended'
20-
| 'vue3-essential'
21-
| 'vue3-recommended'
22-
| 'vue3-strongly-recommended'
14+
type VueConfigKey = import('eslint-plugin-vue').VueConfigKey
2315

2416
const isVue3 = getVueVersion() === 3
2517

2618
const [pluginVue, parserVue] = await Promise.all([
27-
// @ts-expect-error missing types
2819
interopDefault(import('eslint-plugin-vue')),
2920
interopDefault(import('vue-eslint-parser')),
3021
] as const)

src/typings/stub.d.ts

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
declare module 'eslint-plugin-n' {
2+
const plugin: import('eslint').ESLint.Plugin
3+
4+
export default plugin
5+
}
6+
7+
declare module 'eslint-plugin-unicorn' {
8+
const plugin: import('eslint').ESLint.Plugin
9+
10+
export default plugin
11+
}
12+
13+
declare module 'eslint-plugin-i' {
14+
const plugin: import('eslint').ESLint.Plugin
15+
16+
export default plugin
17+
}
18+
19+
declare module 'eslint-config-prettier' {
20+
const plugin: import('eslint').ESLint.Plugin
21+
22+
export default plugin
23+
}
24+
25+
declare module 'eslint-plugin-vue' {
26+
export type VueConfigKey =
27+
| 'base'
28+
| 'essential'
29+
| 'no-layout-rules'
30+
| 'recommended'
31+
| 'strongly-recommended'
32+
| 'vue3-essential'
33+
| 'vue3-recommended'
34+
| 'vue3-strongly-recommended'
35+
36+
type VuePlugin = import('eslint').ESLint.Plugin & {
37+
configs: Record<VueConfigKey, import('eslint').ESLint.ConfigData>
38+
}
39+
40+
const plugin: VuePlugin
41+
42+
export default plugin
43+
}
44+
45+
declare module 'eslint-plugin-react' {
46+
type ReactConfigKey = 'recommended' | 'all' | 'jsx-runtime'
47+
48+
const plugin: import('eslint').ESLint.Plugin & {
49+
configs: Record<ReactConfigKey, import('eslint').ESLint.ConfigData>
50+
}
51+
52+
export default plugin
53+
}
54+
declare module 'eslint-plugin-react-hooks' {
55+
const plugin: import('eslint').ESLint.Plugin
56+
57+
export default plugin
58+
}
59+
declare module 'eslint-plugin-react-refresh' {
60+
const plugin: import('eslint').ESLint.Plugin
61+
62+
export default plugin
63+
}

0 commit comments

Comments
 (0)