diff --git a/packages/language-core/lib/codegen/script/component.ts b/packages/language-core/lib/codegen/script/component.ts index db9305102c..74722a7156 100644 --- a/packages/language-core/lib/codegen/script/component.ts +++ b/packages/language-core/lib/codegen/script/component.ts @@ -31,7 +31,7 @@ export function* generateComponent( yield `}${endOfLine}`; yield `},${newLine}`; if (!ctx.bypassDefineComponent) { - yield* generateScriptSetupOptions(options, ctx, scriptSetup, scriptSetupRanges); + yield* generateScriptSetupOptions(options, ctx, scriptSetup, scriptSetupRanges, true); } if (options.sfc.script && options.scriptRanges) { yield* generateScriptOptions(options.sfc.script, options.scriptRanges); @@ -65,9 +65,10 @@ export function* generateScriptSetupOptions( options: ScriptCodegenOptions, ctx: ScriptCodegenContext, scriptSetup: NonNullable, - scriptSetupRanges: ScriptSetupRanges + scriptSetupRanges: ScriptSetupRanges, + inheritAttrs: boolean ): Generator { - yield* generatePropsOption(options, ctx, scriptSetup, scriptSetupRanges); + yield* generatePropsOption(options, ctx, scriptSetup, scriptSetupRanges, inheritAttrs); yield* generateEmitsOption(options, scriptSetup, scriptSetupRanges); } @@ -75,14 +76,31 @@ export function* generatePropsOption( options: ScriptCodegenOptions, ctx: ScriptCodegenContext, scriptSetup: NonNullable, - scriptSetupRanges: ScriptSetupRanges + scriptSetupRanges: ScriptSetupRanges, + inheritAttrs: boolean ) { - if (options.vueCompilerOptions.target >= 3.5 && ctx.generatedPropsType) { - yield `__typeProps: {} as __VLS_PublicProps,${newLine}`; + + if (options.vueCompilerOptions.target >= 3.5) { + const types = []; + if (inheritAttrs && options.templateCodegen?.inheritedAttrVars.size) { + types.push('typeof __VLS_template>[1]'); + } + if (ctx.generatedPropsType) { + types.push('{} as __VLS_PublicProps'); + } + if (types.length) { + yield `__typeProps: ${types.join(' & ')},${newLine}`; + } } if (options.vueCompilerOptions.target < 3.5 || !ctx.generatedPropsType || scriptSetupRanges.props.withDefaults) { const codegens: (() => Generator)[] = []; + if (inheritAttrs && options.templateCodegen?.inheritedAttrVars.size) { + codegens.push(function* () { + yield `{} as ${ctx.helperTypes.TypePropsToOption.name}<__VLS_PickNotAny<${ctx.helperTypes.OmitIndexSignature.name}[1]>, {}>>`; + }); + } + if (ctx.generatedPropsType) { codegens.push(function* () { yield `{} as `; diff --git a/packages/language-core/lib/codegen/script/context.ts b/packages/language-core/lib/codegen/script/context.ts index 968ba61e33..8bb0ad2176 100644 --- a/packages/language-core/lib/codegen/script/context.ts +++ b/packages/language-core/lib/codegen/script/context.ts @@ -102,6 +102,15 @@ export function createScriptCodegenContext(options: ScriptCodegenOptions) { };`; }, } satisfies HelperType as HelperType, + OmitIndexSignature: { + get name() { + this.used = true; + return `__VLS_OmitIndexSignature`; + }, + get code() { + return `type __VLS_OmitIndexSignature = { [K in keyof T as {} extends Record ? never : K]: T[K]; };`; + } + } satisfies HelperType as HelperType, }; const inlayHints: InlayHintInfo[] = []; diff --git a/packages/language-core/lib/codegen/script/internalComponent.ts b/packages/language-core/lib/codegen/script/internalComponent.ts index 207cd8daa9..458adaf8b8 100644 --- a/packages/language-core/lib/codegen/script/internalComponent.ts +++ b/packages/language-core/lib/codegen/script/internalComponent.ts @@ -49,7 +49,7 @@ export function* generateInternalComponent( yield `}${endOfLine}`; // return { yield `},${newLine}`; // setup() { if (options.sfc.scriptSetup && options.scriptSetupRanges && !ctx.bypassDefineComponent) { - yield* generateScriptSetupOptions(options, ctx, options.sfc.scriptSetup, options.scriptSetupRanges); + yield* generateScriptSetupOptions(options, ctx, options.sfc.scriptSetup, options.scriptSetupRanges, false); } if (options.sfc.script && options.scriptRanges) { yield* generateScriptOptions(options.sfc.script, options.scriptRanges); diff --git a/packages/language-core/lib/codegen/script/scriptSetup.ts b/packages/language-core/lib/codegen/script/scriptSetup.ts index 36cdb4aa15..131d6a497e 100644 --- a/packages/language-core/lib/codegen/script/scriptSetup.ts +++ b/packages/language-core/lib/codegen/script/scriptSetup.ts @@ -67,7 +67,7 @@ export function* generateScriptSetup( + ` props: ${ctx.helperTypes.Prettify.name} & __VLS_BuiltInPublicProps,${newLine}` + ` expose(exposed: import('${options.vueCompilerOptions.lib}').ShallowUnwrapRef<${scriptSetupRanges.expose.define ? 'typeof __VLS_exposed' : '{}'}>): void,${newLine}` + ` attrs: any,${newLine}` - + ` slots: ReturnType,${newLine}` + + ` slots: ReturnType[0],${newLine}` + ` emit: ${emitTypes.join(' & ')},${newLine}` + ` }${endOfLine}`; yield ` })(),${newLine}`; // __VLS_setup = (async () => { @@ -250,7 +250,7 @@ function* generateSetupFunction( yield* generateComponent(options, ctx, scriptSetup, scriptSetupRanges); yield endOfLine; yield `${syntax} `; - yield `{} as ${ctx.helperTypes.WithTemplateSlots.name}>${endOfLine}`; + yield `{} as ${ctx.helperTypes.WithTemplateSlots.name}[0]>${endOfLine}`; } else { yield `${syntax} `; diff --git a/packages/language-core/lib/codegen/script/template.ts b/packages/language-core/lib/codegen/script/template.ts index 8d0dbc85a3..f273a6ddac 100644 --- a/packages/language-core/lib/codegen/script/template.ts +++ b/packages/language-core/lib/codegen/script/template.ts @@ -35,7 +35,7 @@ export function* generateTemplate( const templateUsageVars = [...getTemplateUsageVars(options, ctx)]; yield `// @ts-ignore${newLine}`; yield `[${templateUsageVars.join(', ')}]${newLine}`; - yield `return {}${endOfLine}`; + yield `return [{}, {}] as const${endOfLine}`; yield `}${newLine}`; } } @@ -154,10 +154,11 @@ function* generateTemplateContext( yield `// no template${newLine}`; if (!options.scriptSetupRanges?.slots.define) { yield `const __VLS_slots = {}${endOfLine}`; + yield `const __VLS_inheritedAttrs = {}${endOfLine}`; } } - yield `return ${options.scriptSetupRanges?.slots.name ?? '__VLS_slots'}${endOfLine}`; + yield `return [${options.scriptSetupRanges?.slots.name ?? '__VLS_slots'}, __VLS_inheritedAttrs] as const${endOfLine}`; } function* generateCssClassProperty( diff --git a/packages/language-core/lib/codegen/template/context.ts b/packages/language-core/lib/codegen/template/context.ts index 54b3c5ef03..10d1a7addd 100644 --- a/packages/language-core/lib/codegen/template/context.ts +++ b/packages/language-core/lib/codegen/template/context.ts @@ -125,6 +125,8 @@ export function createTemplateCodegenContext(scriptSetupBindingNames: TemplateCo emptyClassOffsets, inlayHints, hasSlot: false, + inheritedAttrVars: new Set(), + singleRootNode: undefined as CompilerDOM.ElementNode | undefined, accessExternalVariable(name: string, offset?: number) { let arr = accessExternalVariables.get(name); if (!arr) { diff --git a/packages/language-core/lib/codegen/template/element.ts b/packages/language-core/lib/codegen/template/element.ts index 73fa83d5f6..91af8b4bdb 100644 --- a/packages/language-core/lib/codegen/template/element.ts +++ b/packages/language-core/lib/codegen/template/element.ts @@ -224,7 +224,7 @@ export function* generateComponent( yield `, ...__VLS_functionalComponentArgsRest(${var_functionalComponent}))${endOfLine}`; } else { - // without strictTemplates, this only for instacne type + // without strictTemplates, this only for instance type yield `const ${var_componentInstance} = ${var_functionalComponent}({`; yield* generateElementProps(options, ctx, node, props, false); yield `}, ...__VLS_functionalComponentArgsRest(${var_functionalComponent}))${endOfLine}`; @@ -271,6 +271,15 @@ export function* generateComponent( yield `let ${var_componentEvents}!: __VLS_NormalizeEmits${endOfLine}`; } + if ( + node.props.some(prop => prop.type === CompilerDOM.NodeTypes.DIRECTIVE && prop.name === 'bind' && prop.exp?.loc.source === '$attrs') + || node === ctx.singleRootNode + ) { + const varAttrs = ctx.getInternalVariable(); + ctx.inheritedAttrVars.add(varAttrs); + yield `var ${varAttrs}!: Parameters[0];\n`; + } + const slotDir = node.props.find(p => p.type === CompilerDOM.NodeTypes.DIRECTIVE && p.name === 'slot') as CompilerDOM.DirectiveNode; if (slotDir) { yield* generateComponentSlot(options, ctx, node, slotDir, currentComponent, componentCtxVar); @@ -349,6 +358,13 @@ export function* generateElement( else { yield* generateElementChildren(options, ctx, node, currentComponent, componentCtxVar); } + + if ( + node.props.some(prop => prop.type === CompilerDOM.NodeTypes.DIRECTIVE && prop.name === 'bind' && prop.exp?.loc.source === '$attrs') + || node === ctx.singleRootNode + ) { + ctx.inheritedAttrVars.add(`__VLS_intrinsicElements.${node.tag}`); + } } function* generateVScope( diff --git a/packages/language-core/lib/codegen/template/index.ts b/packages/language-core/lib/codegen/template/index.ts index c78716c3b3..5c5665e168 100644 --- a/packages/language-core/lib/codegen/template/index.ts +++ b/packages/language-core/lib/codegen/template/index.ts @@ -17,6 +17,7 @@ export interface TemplateCodegenOptions { hasDefineSlots?: boolean; slotsAssignName?: string; propsAssignName?: string; + inheritAttrs: boolean; } export function* generateTemplate(options: TemplateCodegenOptions): Generator { @@ -43,6 +44,8 @@ export function* generateTemplate(options: TemplateCodegenOptions): Generator { + yield 'var __VLS_inheritedAttrs!: {}'; + for (const varName of ctx.inheritedAttrVars) { + yield ` & typeof ${varName}`; + } + yield endOfLine; + } + function* generateStyleScopedClasses(): Generator { yield `if (typeof __VLS_styleScopedClasses === 'object' && !Array.isArray(__VLS_styleScopedClasses)) {${newLine}`; for (const offset of ctx.emptyClassOffsets) { diff --git a/packages/language-core/lib/codegen/template/templateChild.ts b/packages/language-core/lib/codegen/template/templateChild.ts index b03f366930..999c0d4709 100644 --- a/packages/language-core/lib/codegen/template/templateChild.ts +++ b/packages/language-core/lib/codegen/template/templateChild.ts @@ -47,8 +47,13 @@ export function* generateTemplateChild( } } + const shouldInheritRootNodeAttrs = options.inheritAttrs; + if (node.type === CompilerDOM.NodeTypes.ROOT) { let prev: CompilerDOM.TemplateChildNode | undefined; + if (shouldInheritRootNodeAttrs && node.children.length === 1 && node.children[0].type === CompilerDOM.NodeTypes.ELEMENT) { + ctx.singleRootNode = node.children[0]; + } for (const childNode of node.children) { yield* generateTemplateChild(options, ctx, childNode, currentComponent, prev, componentCtxVar); prev = childNode; diff --git a/packages/language-core/lib/parsers/scriptRanges.ts b/packages/language-core/lib/parsers/scriptRanges.ts index d7c5b81870..01e5101e81 100644 --- a/packages/language-core/lib/parsers/scriptRanges.ts +++ b/packages/language-core/lib/parsers/scriptRanges.ts @@ -13,6 +13,7 @@ export function parseScriptRanges(ts: typeof import('typescript'), ast: ts.Sourc componentsOption: TextRange | undefined, componentsOptionNode: ts.ObjectLiteralExpression | undefined, nameOption: TextRange | undefined, + inheritAttrsOption: string | undefined, }) | undefined; let classBlockEnd: number | undefined; @@ -40,6 +41,7 @@ export function parseScriptRanges(ts: typeof import('typescript'), ast: ts.Sourc if (obj) { let componentsOptionNode: ts.ObjectLiteralExpression | undefined; let nameOptionNode: ts.Expression | undefined; + let inheritAttrsOption: string | undefined; ts.forEachChild(obj, node => { if (ts.isPropertyAssignment(node) && ts.isIdentifier(node.name)) { const name = getNodeText(ts, node.name, ast); @@ -49,6 +51,9 @@ export function parseScriptRanges(ts: typeof import('typescript'), ast: ts.Sourc if (name === 'name') { nameOptionNode = node.initializer; } + if (name === 'inheritAttrs') { + inheritAttrsOption = getNodeText(ts, node.initializer, ast); + } } }); exportDefault = { @@ -59,6 +64,7 @@ export function parseScriptRanges(ts: typeof import('typescript'), ast: ts.Sourc componentsOption: componentsOptionNode ? _getStartEnd(componentsOptionNode) : undefined, componentsOptionNode: withNode ? componentsOptionNode : undefined, nameOption: nameOptionNode ? _getStartEnd(nameOptionNode) : undefined, + inheritAttrsOption, }; } } diff --git a/packages/language-core/lib/parsers/scriptSetupRanges.ts b/packages/language-core/lib/parsers/scriptSetupRanges.ts index 4281e3d8e0..a696920e49 100644 --- a/packages/language-core/lib/parsers/scriptSetupRanges.ts +++ b/packages/language-core/lib/parsers/scriptSetupRanges.ts @@ -40,6 +40,7 @@ export function parseScriptSetupRanges( } = {}; const options: { name?: string; + inheritAttrs?: string; } = {}; const definePropProposalA = vueCompilerOptions.experimentalDefinePropProposal === 'kevinEdition' || ast.text.trimStart().startsWith('// @experimentalDefinePropProposal=kevinEdition'); @@ -101,8 +102,8 @@ export function parseScriptSetupRanges( slots, emits, expose, - defineProp, options, + defineProp, }; function _getStartEnd(node: ts.Node) { @@ -282,6 +283,15 @@ export function parseScriptSetupRanges( } else if (vueCompilerOptions.macros.defineOptions.includes(callText)) { if (node.arguments.length && ts.isObjectLiteralExpression(node.arguments[0])) { + const obj = node.arguments[0]; + ts.forEachChild(obj, node => { + if (ts.isPropertyAssignment(node) && ts.isIdentifier(node.name)) { + const name = getNodeText(ts, node.name, ast); + if (name === 'inheritAttrs') { + options.inheritAttrs = getNodeText(ts, node.initializer, ast); + } + } + }); for (const prop of node.arguments[0].properties) { if ((ts.isPropertyAssignment(prop)) && getNodeText(ts, prop.name, ast) === 'name' && ts.isStringLiteral(prop.initializer)) { options.name = prop.initializer.text; diff --git a/packages/language-core/lib/plugins/vue-tsx.ts b/packages/language-core/lib/plugins/vue-tsx.ts index fcbb3a4208..42e59217e5 100644 --- a/packages/language-core/lib/plugins/vue-tsx.ts +++ b/packages/language-core/lib/plugins/vue-tsx.ts @@ -97,6 +97,7 @@ function createTsx( hasDefineSlots: hasDefineSlots(), slotsAssignName: slotsAssignName(), propsAssignName: propsAssignName(), + inheritAttrs: inheritAttrs(), }); let current = codegen.next(); @@ -135,6 +136,10 @@ function createTsx( }); const slotsAssignName = computed(() => scriptSetupRanges()?.slots.name); const propsAssignName = computed(() => scriptSetupRanges()?.props.name); + const inheritAttrs = computed(() => { + const value = scriptSetupRanges()?.options.inheritAttrs ?? scriptRanges()?.exportDefault?.inheritAttrsOption; + return value !== 'false'; + }); const generatedScript = computed(() => { const codes: Code[] = []; const linkedCodeMappings: Mapping[] = []; diff --git a/packages/tsc/tests/__snapshots__/dts.spec.ts.snap b/packages/tsc/tests/__snapshots__/dts.spec.ts.snap index cb65071221..22142cecc0 100644 --- a/packages/tsc/tests/__snapshots__/dts.spec.ts.snap +++ b/packages/tsc/tests/__snapshots__/dts.spec.ts.snap @@ -11,11 +11,11 @@ declare const _default: (__VLS_props: NonNullable & (import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps); expose(exposed: import("vue").ShallowUnwrapRef<{}>): void; attrs: any; - slots: ReturnType<() => { + slots: ReturnType<() => readonly [{ default?(_: { row: Row; }): any; - }>; + }, import("vue").HTMLAttributes & import("vue").ReservedProps]>[0]; emit: {}; }>) => import("vue").VNode Input: events/component-generic.vue, Output: events/compo }, never>, "onFoo"> & {}> & (import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps); expose(exposed: import("vue").ShallowUnwrapRef<{}>): void; attrs: any; - slots: ReturnType<() => {}>; + slots: ReturnType<() => readonly [{}, {}]>[0]; emit: ((evt: "foo", value: string) => void) & {}; }>) => import("vue").VNode Input: generic/component.vue, Output: generic/component.v baz: number; }>): void; attrs: any; - slots: ReturnType<() => Readonly<{ + slots: ReturnType<() => readonly [Readonly<{ default?(data: { foo: number; }): any; @@ -116,7 +116,7 @@ exports[`vue-tsc-dts > Input: generic/component.vue, Output: generic/component.v default?(data: { foo: number; }): any; - }>; + }, any]>[0]; emit: ((e: "bar", data: number) => void) & ((evt: "update:title", title: string) => void); }>) => import("vue").VNode Input: generic/custom-extension-component.cext, Output: g baz: number; }>): void; attrs: any; - slots: ReturnType<() => Readonly<{ + slots: ReturnType<() => readonly [Readonly<{ default?(data: { foo: number; }): any; @@ -155,7 +155,7 @@ exports[`vue-tsc-dts > Input: generic/custom-extension-component.cext, Output: g default?(data: { foo: number; }): any; - }>; + }, any]>[0]; emit: ((e: "bar", data: number) => void) & ((evt: "update:title", title: string) => void); }>) => import("vue").VNode = { `; exports[`vue-tsc-dts > Input: generic/main.vue, Output: generic/main.vue.d.ts 1`] = ` -"declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly>, {}, {}>; +"declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_OmitIndexSignature<{ + "onUpdate:title"?: (title: string) => any; + onBar?: (data: number) => any; + title?: string; + foo: number; +} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly any; + onBar?: (data: number) => any; + title?: string; + foo: number; +} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps>>>>, {}, {}>; export default _default; +type __VLS_NonUndefinedable = T extends undefined ? never : T; +type __VLS_TypePropsToOption = { + [K in keyof T]-?: {} extends Pick ? { + type: import('vue').PropType<__VLS_NonUndefinedable>; + } : { + type: import('vue').PropType; + required: true; + }; +}; +type __VLS_OmitIndexSignature = { + [K in keyof T as {} extends Record ? never : K]: T[K]; +}; " `; @@ -634,7 +656,7 @@ export {}; `; exports[`vue-tsc-dts > Input: template-slots/component.vue, Output: template-slots/component.vue.d.ts 1`] = ` -"declare function __VLS_template(): { +"declare function __VLS_template(): readonly [{ "no-bind"?(_: {}): any; default?(_: { num: number; @@ -646,9 +668,9 @@ exports[`vue-tsc-dts > Input: template-slots/component.vue, Output: template-slo num: number; str: string; }): any; -}; +}, {}]; declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly>, {}, {}>; -declare const _default: __VLS_WithTemplateSlots>; +declare const _default: __VLS_WithTemplateSlots[0]>; export default _default; type __VLS_WithTemplateSlots = T & { new (): { @@ -660,7 +682,7 @@ type __VLS_WithTemplateSlots = T & { exports[`vue-tsc-dts > Input: template-slots/component-define-slots.vue, Output: template-slots/component-define-slots.vue.d.ts 1`] = ` "import { VNode } from 'vue'; -declare function __VLS_template(): Readonly<{ +declare function __VLS_template(): readonly [Readonly<{ default: (props: { num: number; }) => VNode[]; @@ -684,9 +706,9 @@ declare function __VLS_template(): Readonly<{ str: string; }) => VNode[]; 'no-bind': () => VNode[]; -}; +}, {}]; declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly>, {}, {}>; -declare const _default: __VLS_WithTemplateSlots>; +declare const _default: __VLS_WithTemplateSlots[0]>; export default _default; type __VLS_WithTemplateSlots = T & { new (): { @@ -697,7 +719,7 @@ type __VLS_WithTemplateSlots = T & { `; exports[`vue-tsc-dts > Input: template-slots/component-destructuring.vue, Output: template-slots/component-destructuring.vue.d.ts 1`] = ` -"declare function __VLS_template(): Readonly<{ +"declare function __VLS_template(): readonly [Readonly<{ bottom: (props: { num: number; }) => any[]; @@ -705,9 +727,9 @@ exports[`vue-tsc-dts > Input: template-slots/component-destructuring.vue, Output bottom: (props: { num: number; }) => any[]; -}; +}, {}]; declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly>, {}, {}>; -declare const _default: __VLS_WithTemplateSlots>; +declare const _default: __VLS_WithTemplateSlots[0]>; export default _default; type __VLS_WithTemplateSlots = T & { new (): { @@ -718,7 +740,7 @@ type __VLS_WithTemplateSlots = T & { `; exports[`vue-tsc-dts > Input: template-slots/component-no-script.vue, Output: template-slots/component-no-script.vue.d.ts 1`] = ` -"declare function __VLS_template(): { +"declare function __VLS_template(): readonly [{ "no-bind"?(_: {}): any; default?(_: { num: number; @@ -730,9 +752,9 @@ exports[`vue-tsc-dts > Input: template-slots/component-no-script.vue, Output: te num: number; str: string; }): any; -}; +}, {}]; declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly>, {}, {}>; -declare const _default: __VLS_WithTemplateSlots>; +declare const _default: __VLS_WithTemplateSlots[0]>; export default _default; type __VLS_WithTemplateSlots = T & { new (): { diff --git a/test-workspace/tsc/passedFixtures/vue2_strictTemplate/tsconfig.json b/test-workspace/tsc/passedFixtures/vue2_strictTemplate/tsconfig.json index 141c51abdd..2011fc02db 100644 --- a/test-workspace/tsc/passedFixtures/vue2_strictTemplate/tsconfig.json +++ b/test-workspace/tsc/passedFixtures/vue2_strictTemplate/tsconfig.json @@ -12,5 +12,6 @@ "../vue3_strictTemplate/#3140", "../vue3_strictTemplate/#3718", "../vue3_strictTemplate/intrinsicProps", + "../vue3_strictTemplate/inheritAttrs", ] } diff --git a/test-workspace/tsc/passedFixtures/vue3_strictTemplate/#4699/HelloWorld.vue b/test-workspace/tsc/passedFixtures/vue3_strictTemplate/#4699/HelloWorld.vue new file mode 100644 index 0000000000..b91a472477 --- /dev/null +++ b/test-workspace/tsc/passedFixtures/vue3_strictTemplate/#4699/HelloWorld.vue @@ -0,0 +1,42 @@ + + + + + diff --git a/test-workspace/tsc/passedFixtures/vue3_strictTemplate/#4699/main.vue b/test-workspace/tsc/passedFixtures/vue3_strictTemplate/#4699/main.vue new file mode 100644 index 0000000000..724454b611 --- /dev/null +++ b/test-workspace/tsc/passedFixtures/vue3_strictTemplate/#4699/main.vue @@ -0,0 +1,9 @@ + + + diff --git a/test-workspace/tsc/passedFixtures/vue3_strictTemplate/inheritAttrs/basic.vue b/test-workspace/tsc/passedFixtures/vue3_strictTemplate/inheritAttrs/basic.vue new file mode 100644 index 0000000000..638d60b11f --- /dev/null +++ b/test-workspace/tsc/passedFixtures/vue3_strictTemplate/inheritAttrs/basic.vue @@ -0,0 +1,7 @@ + + + diff --git a/test-workspace/tsc/passedFixtures/vue3_strictTemplate/inheritAttrs/child.vue b/test-workspace/tsc/passedFixtures/vue3_strictTemplate/inheritAttrs/child.vue new file mode 100644 index 0000000000..b788b48f99 --- /dev/null +++ b/test-workspace/tsc/passedFixtures/vue3_strictTemplate/inheritAttrs/child.vue @@ -0,0 +1,9 @@ + diff --git a/test-workspace/tsc/passedFixtures/vue3_strictTemplate/inheritAttrs/define-options-inherit-attrs-false.vue b/test-workspace/tsc/passedFixtures/vue3_strictTemplate/inheritAttrs/define-options-inherit-attrs-false.vue new file mode 100644 index 0000000000..c07f8a71ea --- /dev/null +++ b/test-workspace/tsc/passedFixtures/vue3_strictTemplate/inheritAttrs/define-options-inherit-attrs-false.vue @@ -0,0 +1,11 @@ + + + diff --git a/test-workspace/tsc/passedFixtures/vue3_strictTemplate/inheritAttrs/inherit-attrs-false-v-bind.vue b/test-workspace/tsc/passedFixtures/vue3_strictTemplate/inheritAttrs/inherit-attrs-false-v-bind.vue new file mode 100644 index 0000000000..0aad51f4fd --- /dev/null +++ b/test-workspace/tsc/passedFixtures/vue3_strictTemplate/inheritAttrs/inherit-attrs-false-v-bind.vue @@ -0,0 +1,15 @@ + + + + + diff --git a/test-workspace/tsc/passedFixtures/vue3_strictTemplate/inheritAttrs/inherit-attrs-false.vue b/test-workspace/tsc/passedFixtures/vue3_strictTemplate/inheritAttrs/inherit-attrs-false.vue new file mode 100644 index 0000000000..c2ce35f349 --- /dev/null +++ b/test-workspace/tsc/passedFixtures/vue3_strictTemplate/inheritAttrs/inherit-attrs-false.vue @@ -0,0 +1,15 @@ + + + + + diff --git a/test-workspace/tsc/passedFixtures/vue3_strictTemplate/inheritAttrs/main.vue b/test-workspace/tsc/passedFixtures/vue3_strictTemplate/inheritAttrs/main.vue new file mode 100644 index 0000000000..b9a545507a --- /dev/null +++ b/test-workspace/tsc/passedFixtures/vue3_strictTemplate/inheritAttrs/main.vue @@ -0,0 +1,16 @@ + + + diff --git a/test-workspace/tsc/passedFixtures/vue3_strictTemplate/tsconfig.json b/test-workspace/tsc/passedFixtures/vue3_strictTemplate/tsconfig.json index 61ae6aab5d..13bbce6e2e 100644 --- a/test-workspace/tsc/passedFixtures/vue3_strictTemplate/tsconfig.json +++ b/test-workspace/tsc/passedFixtures/vue3_strictTemplate/tsconfig.json @@ -1,7 +1,7 @@ { "extends": "../../../tsconfig.base.json", "vueCompilerOptions": { - "strictTemplates": true + "strictTemplates": true, }, "include": [ "**/*" ], }