Skip to content

Commit

Permalink
fix(vue-tsc): throw error and hint user when vue-tsc working with typ…
Browse files Browse the repository at this point in the history
…escript lower than 5.0.0 (#349)
  • Loading branch information
fi3ework authored Jul 2, 2024
1 parent e881c44 commit 78fc007
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/tiny-impalas-cheat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'vite-plugin-checker': patch
---

Throw error and hint user when vue-tsc working with typescript lower than 5.0.0
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ export async function prepareVueTsc() {
const vueTscFlagFile = path.resolve(targetTsDir, 'vue-tsc-resolve-path')
const currTsVersion = _require('typescript/package.json').version

const tsMajorVersion = Number(currTsVersion.split('.')[0])
if (tsMajorVersion < 5) {
throw new Error(
"\x1b[35m[vite-plugin-checker] Since 0.7.0, vue-tsc checkers requires TypeScript 5.0.0 or newer version.\nPlease upgrade TypeScript, or use v0.6.4 which works with vue-tsc^1 if you can't upgrade. Check the pull request https://github.com/fi3ework/vite-plugin-checker/pull/327 for detail.\x1b[39m\n"
)
}

let shouldBuildFixture = true
try {
await access(targetTsDir)
Expand Down

0 comments on commit 78fc007

Please sign in to comment.