diff --git a/.github/ISSUE_TEMPLATE/1-bug-report.md b/.github/ISSUE_TEMPLATE/1-bug-report.md index f9e55808..df53b9d2 100644 --- a/.github/ISSUE_TEMPLATE/1-bug-report.md +++ b/.github/ISSUE_TEMPLATE/1-bug-report.md @@ -26,7 +26,9 @@ A clear and concise description of what you expected to happen. ### 🌍 Environment - prettier-plugin-ember-template-tag version: - -- ember-template-imports version: - +- ember-template-imports version (if applicable): - +- content-tag version (if applicable): - +- eslint-plugin-ember version (if applicable): - ### ➕ Additional Context diff --git a/design.md b/design.md index b09612d5..a964676b 100644 --- a/design.md +++ b/design.md @@ -1,15 +1,14 @@ # The Plan -1. Run `preprocessEmbeddedTemplates` from ember-template-imports to convert gjs files with ` as TemplateOnlyComponent; oops => {}; " `; @@ -1173,7 +1173,7 @@ export interface Signature { as TemplateOnlyComponent + as TemplateOnlyComponent; oops => {}; " `; @@ -1192,7 +1192,7 @@ export interface Signature { module top level component. Explicit default export module top level component. Explicit default export module top level component. Explicit default export module top level component. - as TemplateOnlyComponent + as TemplateOnlyComponent; oops => {}; " `; @@ -1244,7 +1244,7 @@ export interface Signature { as TemplateOnlyComponent + as TemplateOnlyComponent; oops => {}; " `; @@ -1262,7 +1262,7 @@ export interface Signature { module top level component. Explicit default export module top level component. Explicit default export module top level component. Explicit default export module top level component. - as TemplateOnlyComponent + as TemplateOnlyComponent; oops => {}; " `; @@ -1311,7 +1311,7 @@ export interface Signature { as TemplateOnlyComponent + as TemplateOnlyComponent; oops => {}; " `; diff --git a/tests/unit-tests/ambiguous/__snapshots__/index.test.ts.snap b/tests/unit-tests/ambiguous/__snapshots__/index.test.ts.snap index 6a1bc150..123cdc7f 100644 --- a/tests/unit-tests/ambiguous/__snapshots__/index.test.ts.snap +++ b/tests/unit-tests/ambiguous/__snapshots__/index.test.ts.snap @@ -1836,67 +1836,46 @@ export interface Signature { " `; -exports[`ambiguous > config > default > +"oops" > without semi, with newline > it formats ../cases/gjs/js-only.gjs 1`] = ` -"const num = 1 + \\"oops\\"; -" -`; - -exports[`ambiguous > config > default > +"oops" > without semi, with newline > it formats ../cases/gts/js-only.gts 1`] = ` -"const num: number = 1 + \\"oops\\"; -" -`; - -exports[`ambiguous > config > default > +"oops" > without semi, without newline > it formats ../cases/gjs/js-only.gjs 1`] = ` -"const num = 1 + \\"oops\\"; -" -`; - -exports[`ambiguous > config > default > +"oops" > without semi, without newline > it formats ../cases/gts/js-only.gts 1`] = ` -"const num: number = 1 + \\"oops\\"; -" -`; - -exports[`ambiguous > config > default > /oops/ > with semi, with newline > it formats ../cases/gjs/default-export.gjs 1`] = ` +exports[`ambiguous > config > default > +"oops" > without semi, with newline > it formats ../cases/gjs/default-export.gjs 1`] = ` "; -/oops/; ++\\"oops\\"; " `; -exports[`ambiguous > config > default > /oops/ > with semi, with newline > it formats ../cases/gjs/exported-mod-var.gjs 1`] = ` +exports[`ambiguous > config > default > +"oops" > without semi, with newline > it formats ../cases/gjs/exported-mod-var.gjs 1`] = ` "export const Exported = ; -/oops/; ++\\"oops\\"; " `; -exports[`ambiguous > config > default > /oops/ > with semi, with newline > it formats ../cases/gjs/js-only.gjs 1`] = ` -"const num = 1; -/oops/; +exports[`ambiguous > config > default > +"oops" > without semi, with newline > it formats ../cases/gjs/js-only.gjs 1`] = ` +"const num = 1 + \\"oops\\"; " `; -exports[`ambiguous > config > default > /oops/ > with semi, with newline > it formats ../cases/gjs/mod-var.gjs 1`] = ` +exports[`ambiguous > config > default > +"oops" > without semi, with newline > it formats ../cases/gjs/mod-var.gjs 1`] = ` "const Private = ; -/oops/; ++\\"oops\\"; const What = ; -/oops/; ++\\"oops\\"; " `; -exports[`ambiguous > config > default > /oops/ > with semi, with newline > it formats ../cases/gjs/multiple-declarations.gjs 1`] = ` +exports[`ambiguous > config > default > +"oops" > without semi, with newline > it formats ../cases/gjs/multiple-declarations.gjs 1`] = ` "const ModVar1 = , ModVar2 = , - num = 1; -/oops/; + num = 1 + \\"oops\\"; const bool = false, ModVar3 = , ModVar4 = ; -/oops/; ++\\"oops\\"; " `; -exports[`ambiguous > config > default > /oops/ > with semi, with newline > it formats ../cases/gjs/simple.gjs 1`] = ` +exports[`ambiguous > config > default > +"oops" > without semi, with newline > it formats ../cases/gjs/simple.gjs 1`] = ` "; -/oops/; ++\\"oops\\"; " `; -exports[`ambiguous > config > default > /oops/ > with semi, with newline > it formats ../cases/gts/default-export.gts 1`] = ` +exports[`ambiguous > config > default > +"oops" > without semi, with newline > it formats ../cases/gts/default-export.gts 1`] = ` "import type { TemplateOnlyComponent } from \\"@ember/component/template-only\\"; export interface Signature { @@ -1938,17 +1916,16 @@ export interface Signature { Yields: []; } - as TemplateOnlyComponent) + \\"oops\\"; " `; -exports[`ambiguous > config > default > /oops/ > with semi, with newline > it formats ../cases/gts/exported-mod-var.gts 1`] = ` +exports[`ambiguous > config > default > +"oops" > without semi, with newline > it formats ../cases/gts/exported-mod-var.gts 1`] = ` "import type { TemplateOnlyComponent } from \\"@ember/component/template-only\\"; export interface Signature { @@ -1962,11 +1939,11 @@ export const Exported: TemplateOnlyComponent = ; -/oops/; ++\\"oops\\"; " `; -exports[`ambiguous > config > default > /oops/ > with semi, with newline > it formats ../cases/gts/exported-mod-var-with-as.gts 1`] = ` +exports[`ambiguous > config > default > +"oops" > without semi, with newline > it formats ../cases/gts/exported-mod-var-with-as.gts 1`] = ` "import type { TemplateOnlyComponent } from \\"@ember/component/template-only\\"; export interface Signature { @@ -1975,22 +1952,21 @@ export interface Signature { Yields: []; } -export const Exported = as TemplateOnlyComponent; -/oops/; +export const Exported = + ( as TemplateOnlyComponent) + \\"oops\\"; " `; -exports[`ambiguous > config > default > /oops/ > with semi, with newline > it formats ../cases/gts/js-only.gts 1`] = ` -"const num: number = 1; -/oops/; +exports[`ambiguous > config > default > +"oops" > without semi, with newline > it formats ../cases/gts/js-only.gts 1`] = ` +"const num: number = 1 + \\"oops\\"; " `; -exports[`ambiguous > config > default > /oops/ > with semi, with newline > it formats ../cases/gts/mod-var.gts 1`] = ` +exports[`ambiguous > config > default > +"oops" > without semi, with newline > it formats ../cases/gts/mod-var.gts 1`] = ` "import type { TemplateOnlyComponent } from \\"@ember/component/template-only\\"; export interface Signature { @@ -2004,11 +1980,11 @@ const Private: TemplateOnlyComponent = ; -/oops/; ++\\"oops\\"; " `; -exports[`ambiguous > config > default > /oops/ > with semi, with newline > it formats ../cases/gts/mod-var-with-as.gts 1`] = ` +exports[`ambiguous > config > default > +"oops" > without semi, with newline > it formats ../cases/gts/mod-var-with-as.gts 1`] = ` "import type { TemplateOnlyComponent } from \\"@ember/component/template-only\\"; export interface Signature { @@ -2017,16 +1993,16 @@ export interface Signature { Yields: []; } -const Private = as TemplateOnlyComponent; -/oops/; +const Private = + ( as TemplateOnlyComponent) + \\"oops\\"; " `; -exports[`ambiguous > config > default > /oops/ > with semi, with newline > it formats ../cases/gts/multiple-declarations.gts 1`] = ` +exports[`ambiguous > config > default > +"oops" > without semi, with newline > it formats ../cases/gts/multiple-declarations.gts 1`] = ` "import type { TemplateOnlyComponent } from \\"@ember/component/template-only\\"; export interface Signature { @@ -2045,8 +2021,7 @@ const ModVar1: TemplateOnlyComponent = as TemplateOnlyComponent - + as TemplateOnlyComponent; +/oops/; " `; -exports[`ambiguous > config > default > > with semi, without newline > it formats ../cases/gts/exported-mod-var.gts 1`] = ` +exports[`ambiguous > config > default > /oops/ > with semi, without newline > it formats ../cases/gts/exported-mod-var.gts 1`] = ` "import type { TemplateOnlyComponent } from \\"@ember/component/template-only\\"; export interface Signature { @@ -2858,13 +2696,11 @@ export const Exported: TemplateOnlyComponent = ; - +/oops/; " `; -exports[`ambiguous > config > default > > with semi, without newline > it formats ../cases/gts/exported-mod-var-with-as.gts 1`] = ` +exports[`ambiguous > config > default > /oops/ > with semi, without newline > it formats ../cases/gts/exported-mod-var-with-as.gts 1`] = ` "import type { TemplateOnlyComponent } from \\"@ember/component/template-only\\"; export interface Signature { @@ -2878,21 +2714,17 @@ export const Exported = as TemplateOnlyComponent; - +/oops/; " `; -exports[`ambiguous > config > default > > with semi, without newline > it formats ../cases/gts/js-only.gts 1`] = ` +exports[`ambiguous > config > default > /oops/ > with semi, without newline > it formats ../cases/gts/js-only.gts 1`] = ` "const num: number = 1; - +/oops/; " `; -exports[`ambiguous > config > default > > with semi, without newline > it formats ../cases/gts/mod-var.gts 1`] = ` +exports[`ambiguous > config > default > /oops/ > with semi, without newline > it formats ../cases/gts/mod-var.gts 1`] = ` "import type { TemplateOnlyComponent } from \\"@ember/component/template-only\\"; export interface Signature { @@ -2906,13 +2738,11 @@ const Private: TemplateOnlyComponent = ; - +/oops/; " `; -exports[`ambiguous > config > default > > with semi, without newline > it formats ../cases/gts/mod-var-with-as.gts 1`] = ` +exports[`ambiguous > config > default > /oops/ > with semi, without newline > it formats ../cases/gts/mod-var-with-as.gts 1`] = ` "import type { TemplateOnlyComponent } from \\"@ember/component/template-only\\"; export interface Signature { @@ -2926,13 +2756,11 @@ const Private = as TemplateOnlyComponent; - +/oops/; " `; -exports[`ambiguous > config > default > > with semi, without newline > it formats ../cases/gts/multiple-declarations.gts 1`] = ` +exports[`ambiguous > config > default > /oops/ > with semi, without newline > it formats ../cases/gts/multiple-declarations.gts 1`] = ` "import type { TemplateOnlyComponent } from \\"@ember/component/template-only\\"; export interface Signature { @@ -2952,9 +2780,8 @@ const ModVar1: TemplateOnlyComponent = , num = 1; - +/oops/; + const bool: boolean = false, ModVar3: TemplateOnlyComponent =