From e5443694da53b9646fd072f13af36e86c1f9987b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=90=91=E5=A4=9C?= Date: Tue, 25 Jun 2024 21:39:27 +0800 Subject: [PATCH] chore(types): fix vscode type check in `*.jsx` Resolved: #1899 --- packages/devui-vue/devui/shims-vue.d.ts | 11 +++++++++++ packages/devui-vue/tsconfig.json | 8 ++++---- 2 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 packages/devui-vue/devui/shims-vue.d.ts diff --git a/packages/devui-vue/devui/shims-vue.d.ts b/packages/devui-vue/devui/shims-vue.d.ts new file mode 100644 index 0000000000..ca42fdc7de --- /dev/null +++ b/packages/devui-vue/devui/shims-vue.d.ts @@ -0,0 +1,11 @@ +// devui/shims-vue.d.ts +import { VNode } from 'vue'; + +declare type VueNode = VNode; +declare global { + namespace JSX { + interface IntrinsicElements { + [elem: string]: unknown; + } + } +} diff --git a/packages/devui-vue/tsconfig.json b/packages/devui-vue/tsconfig.json index ed11a5080a..dfa271717a 100644 --- a/packages/devui-vue/tsconfig.json +++ b/packages/devui-vue/tsconfig.json @@ -6,17 +6,17 @@ "strict": true, "jsx": "preserve", "sourceMap": true, - "lib": ["esnext", "dom","DOM.Iterable"], - "types": ["vite/client", "jest","node"], + "lib": ["esnext", "dom", "DOM.Iterable"], + "types": ["vite/client", "jest", "node"], "esModuleInterop": true, "plugins": [{ "name": "@vuedx/typescript-plugin-vue" }], "paths": { "hooks/*": ["./devui/shared/hooks/*"], "@devui/shared/components/*": ["./devui/*"], - "@devui/*": ["./devui/*"], + "@devui/*": ["./devui/*"] }, "declaration": true, - "declarationDir": "build/types", + "declarationDir": "build/types" }, "include": ["devui/**/*.ts", "devui/**/*.d.ts", "devui/**/*.tsx", "devui/**/*.vue"] }