Skip to content

Commit

Permalink
fix: unknown jsx property support for vue 2.7 (#1533)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoxiangmoe committed Jul 6, 2022
1 parent 1171a44 commit bb936cc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/vue-typescript/src/lsContext.ts
Expand Up @@ -307,7 +307,12 @@ export function createLanguageServiceContext(
}
let tsScript = host.getScriptSnapshot(fileName);
if (tsScript) {
if ((vueCompilerOptions.experimentalSuppressUnknownJsxPropertyErrors ?? true) && basename === 'runtime-dom.d.ts') {
if ((vueCompilerOptions.experimentalSuppressUnknownJsxPropertyErrors ?? true) && (
// for vue 2.6 and vue 3
basename === 'runtime-dom.d.ts' ||
// for vue 2.7
basename === 'jsx.d.ts'
)) {
// allow arbitrary attributes
let tsScriptText = tsScript.getText(0, tsScript.getLength());
tsScriptText = tsScriptText.replace(
Expand Down

0 comments on commit bb936cc

Please sign in to comment.