Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d702641

Browse files
committed
fix: type error
1 parent febe178 commit d702641

File tree

9 files changed

+105
-58
lines changed

9 files changed

+105
-58
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626

2727
- run: pnpm install
2828
- run: pnpm run lint
29+
- run: pnpm run typecheck
2930

3031
ci:
3132
runs-on: ${{ matrix.os }}

docs/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"gen-files": "tsx ./.vitepress/data/gen-files.ts",
1010
"dev": "vitepress dev --open",
1111
"build": "pnpm gen-files && vitepress build",
12-
"lint": "eslint . && case-police '**/*.md'"
12+
"lint": "case-police '**/*.md'",
13+
"typecheck": "vue-tsc --noEmit"
1314
},
1415
"devDependencies": {
1516
"@iconify/json": "^2.2.277",
@@ -28,6 +29,7 @@
2829
"unplugin-vue-components": "^0.27.5",
2930
"vitepress": "^1.5.0",
3031
"vitepress-plugin-group-icons": "^1.3.0",
31-
"vue": "^3.5.13"
32+
"vue": "^3.5.13",
33+
"vue-tsc": "^2.1.10"
3234
}
3335
}

docs/tsconfig.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"include": [".vitepress/**/*"]
4+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"rollup": "^4.27.4",
7171
"simple-git-hooks": "^2.11.1",
7272
"tsup": "^8.3.5",
73-
"typescript": "^5.7.2",
73+
"typescript": "~5.6.3",
7474
"unplugin": "workspace:*",
7575
"unplugin-unused": "^0.2.3",
7676
"vite": "^6.0.1",

pnpm-lock.yaml

Lines changed: 84 additions & 47 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/rspack/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export function getRspackPlugin<UserOptions = Record<string, never>>(
6969
const vfs = new FakeVirtualModulesPlugin(plugin)
7070
vfs.apply(compiler)
7171
plugin.__vfsModules = new Set()
72-
plugin.__vfs = vfs
72+
plugin.__vfs = vfs as any
7373

7474
compiler.hooks.compilation.tap(plugin.name, (compilation, { normalModuleFactory }) => {
7575
normalModuleFactory.hooks.resolve.tapPromise(plugin.name, async (resolveData) => {

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import type { Compilation as WebpackCompilation, Compiler as WebpackCompiler, Lo
88
import type VirtualModulesPlugin from 'webpack-virtual-modules'
99
import type { EsbuildPluginBuild } from './esbuild'
1010

11-
export {
11+
export type {
1212
EsbuildPlugin,
1313
RolldownPlugin,
1414
RollupPlugin,

test/unit-tests/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const viteBuild = vite.build
1010
export const rollupBuild = rollup.rollup
1111
export const esbuildBuild = esbuild.build
1212
export const webpackBuild: typeof webpack.webpack = webpack.webpack || (webpack as any).default || webpack
13-
export const rspackBuild = rspack.rspack
13+
export const rspackBuild: typeof rspack.rspack = rspack.rspack
1414

1515
export const webpackVersion = ((webpack as any).default || webpack).version
1616

tsconfig.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
{
22
"compilerOptions": {
3-
"target": "ESNext",
4-
"module": "ESNext",
5-
"moduleResolution": "Node",
3+
"target": "esnext",
4+
"lib": ["es2023"],
5+
"moduleDetection": "force",
6+
"module": "preserve",
7+
"moduleResolution": "bundler",
68
"paths": {
79
"unplugin": [
810
"./src/index.ts"
@@ -14,13 +16,14 @@
1416
],
1517
"strict": true,
1618
"declaration": true,
19+
"noEmit": true,
1720
"esModuleInterop": true,
1821
"isolatedModules": true,
22+
"verbatimModuleSyntax": true,
1923
"skipLibCheck": true
2024
},
2125
"include": [
2226
"src",
23-
"test",
24-
"docs/.vitepress/**/*"
27+
"test"
2528
]
2629
}

0 commit comments

Comments
 (0)