From 689402c6c15fe67d9638bf21f81bfd24702b2330 Mon Sep 17 00:00:00 2001 From: jeneser Date: Wed, 28 Oct 2020 17:07:53 +0000 Subject: [PATCH 1/2] fix: update default vue 3 typescript shim --- .../codemods/__testfixtures__/shims-vue.output.ts | 2 +- .../generator/template-vue3/src/shims-vue.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/@vue/cli-plugin-typescript/codemods/__testfixtures__/shims-vue.output.ts b/packages/@vue/cli-plugin-typescript/codemods/__testfixtures__/shims-vue.output.ts index 506bf2e5c9..7805834a0f 100644 --- a/packages/@vue/cli-plugin-typescript/codemods/__testfixtures__/shims-vue.output.ts +++ b/packages/@vue/cli-plugin-typescript/codemods/__testfixtures__/shims-vue.output.ts @@ -1,5 +1,5 @@ declare module '*.vue' { import { DefineComponent } from 'vue'; - const component: DefineComponent<{}, {}, any>; + const component: DefineComponent<{}, {}, unknown>; export default component; } diff --git a/packages/@vue/cli-plugin-typescript/generator/template-vue3/src/shims-vue.d.ts b/packages/@vue/cli-plugin-typescript/generator/template-vue3/src/shims-vue.d.ts index 2b97bd961c..bdc11b4f80 100644 --- a/packages/@vue/cli-plugin-typescript/generator/template-vue3/src/shims-vue.d.ts +++ b/packages/@vue/cli-plugin-typescript/generator/template-vue3/src/shims-vue.d.ts @@ -1,5 +1,5 @@ declare module '*.vue' { import type { DefineComponent } from 'vue' - const component: DefineComponent<{}, {}, any> + const component: DefineComponent<{}, {}, unknown> export default component } From 7b1097d4575edbb3bd80d2a2e483a51561a6cb4b Mon Sep 17 00:00:00 2001 From: jeneser Date: Thu, 29 Oct 2020 02:58:11 +0000 Subject: [PATCH 2/2] fix: the failing tests --- .../@vue/cli-plugin-typescript/codemods/migrateComponentType.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@vue/cli-plugin-typescript/codemods/migrateComponentType.js b/packages/@vue/cli-plugin-typescript/codemods/migrateComponentType.js index 1c2a208331..16de77149c 100644 --- a/packages/@vue/cli-plugin-typescript/codemods/migrateComponentType.js +++ b/packages/@vue/cli-plugin-typescript/codemods/migrateComponentType.js @@ -50,7 +50,7 @@ module.exports = function migrateComponentType (file, api) { j.tsTypeParameterInstantiation([ j.tsTypeLiteral([]), j.tsTypeLiteral([]), - j.tsAnyKeyword() + j.tsUnknownKeyword() ]) ) )