Skip to content

Commit

Permalink
fix(language-tools): no longer need typescript version patch
Browse files Browse the repository at this point in the history
  • Loading branch information
haoqunjiang committed Apr 25, 2024
1 parent f8c996e commit 989a7c7
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions tests/language-tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ export async function test(options: RunOptions) {
beforeBuild: 'pnpm dedupe',
build: 'build',
test: 'test',
patchFiles: {
'package.json': (content) => {
const pkg = JSON.parse(content)
// As of 2024-03-19,
// the version of TypeScript in the package.json is latest, which resolves to 5.4.2 if we dedupe it.
// The new feature in TypeScript 5.4,
// [Preserved Narrowing in Closures Following Last Assignments](https://devblogs.microsoft.com/typescript/announcing-typescript-5-4/#preserved-narrowing-in-closures-following-last-assignments),
// would cause a type error at <https://github.com/vuejs/language-tools/blob/58a820281d4b4a8b2d484a7fa2a2eb73e5eb4daf/packages/language-service/lib/plugins/vue-document-drop.ts#L88>.
// There are also other tests broken by TypeScript 5.4.
// So we need to pin the version to ~5.3.3.
pkg.devDependencies.typescript = '~5.3.3'
return JSON.stringify(pkg, null, 2)
},
},
// patchFiles: {
// 'package.json': (content) => {
// const pkg = JSON.parse(content)
// // As of 2024-03-19,
// // the version of TypeScript in the package.json is latest, which resolves to 5.4.2 if we dedupe it.
// // The new feature in TypeScript 5.4,
// // [Preserved Narrowing in Closures Following Last Assignments](https://devblogs.microsoft.com/typescript/announcing-typescript-5-4/#preserved-narrowing-in-closures-following-last-assignments),
// // would cause a type error at <https://github.com/vuejs/language-tools/blob/58a820281d4b4a8b2d484a7fa2a2eb73e5eb4daf/packages/language-service/lib/plugins/vue-document-drop.ts#L88>.
// // There are also other tests broken by TypeScript 5.4.
// // So we need to pin the version to ~5.3.3.
// pkg.devDependencies.typescript = '~5.3.3'
// return JSON.stringify(pkg, null, 2)
// },
// },
})
}

0 comments on commit 989a7c7

Please sign in to comment.