Fix formatting for tagged template decorators (#11717)

* Fix formatting for tagged template decorators

* Add changelog
This commit is contained in:
Sosuke Suzuki authored and GitHub committed 2021-10-25 21:23:42 +09:00
1 parent d3163259c7
commit 6f602d1126
8 files changed
+88

No files matched your search

@@ -41,6 +41,16 @@ exports[`multiline-declaration-type.ts [babel-ts] format 1`] = `
3 |"
`;
exports[`parenthesized-decorators-tagged-template.ts [babel-ts] format 1`] = `
"Unexpected token (2:7)
1 | class Test {
> 2 | @foo\`bar\`
| ^
3 | text: string = \\"text\\"
4 | }
5 |"
`;
exports[`type-annotation-expr-statement.ts [babel-ts] format 1`] = `
"Did not expect a type annotation here. (1:3)
> 1 | (a: T);
@@ -0,0 +1,4 @@
class Test {
@foo`bar`
text: string = "text"
}
@@ -60,6 +60,26 @@ class Bar {
================================================================================
`;
exports[`parenthesized-decorators-tagged-template.ts format 1`] = `
====================================options=====================================
parsers: ["babel-ts"]
printWidth: 80
| printWidth
=====================================input======================================
class Test {
@(foo\`bar\`)
text: string = "text"
}
=====================================output=====================================
class Test {
@(foo\`bar\`)
text: string = "text";
}
================================================================================
`;
exports[`prettier-ignore-nested-unions.ts format 1`] = `
====================================options=====================================
parsers: ["babel-ts"]
@@ -0,0 +1,4 @@
class Test {
@(foo`bar`)
text: string = "text"
}
@@ -93,6 +93,26 @@ class Bar {
================================================================================
`;
exports[`parenthesized-decorators-tagged-template.ts format 1`] = `
====================================options=====================================
parsers: ["typescript"]
printWidth: 80
| printWidth
=====================================input======================================
class Test {
@foo\`bar\`
text: string = "text"
}
=====================================output=====================================
class Test {
@foo\`bar\`
text: string = "text";
}
================================================================================
`;
exports[`prettier-ignore-parenthesized-type.ts format 1`] = `
====================================options=====================================
parsers: ["typescript"]
@@ -0,0 +1,4 @@
class Test {
@foo`bar`
text: string = "text"
}