Fix TS type formatting
Closes
MODIFY
packages/@romejs/js-ast-utils/doesNodeMatchPattern.ts
packages/@romejs/js-ast-utils/doesNodeMatchPattern.ts
@@ -53,7 +53,7 @@ export default function doesNodeMatchPattern(
const {parts: expectedParts, hasDoubleStar} = split(match);
// Fast path for single part pattern matching
- if (expectedParts.length === 1 && expectedParts[0] !== '*' && !hasDoubleStar) {
+ if (expectedParts.length === 1 && expectedParts[0] !== "*" && !hasDoubleStar) {
return isIdentifierish(node) && node.name === expectedParts[0];
}

MODIFY
packages/@romejs/js-formatter/builders/typescript/TypeAliasTypeAnnotation.ts
packages/@romejs/js-formatter/builders/typescript/TypeAliasTypeAnnotation.ts
*/
import Builder from "../../Builder";
-import {Token, concat, space} from "../../tokens";
+import {Token, concat, group, space} from "../../tokens";
import {TypeAliasTypeAnnotation} from "@romejs/js-ast";
export default function TypeAliasTypeAnnotation(
builder: Builder,
node: TypeAliasTypeAnnotation,
): Token {
- return concat([
+ return group(
+ concat([
"type",
space,
builder.tokenize(node.id, node),
@@ -23,5 +24,6 @@ export default function TypeAliasTypeAnnotation(
space,
builder.tokenize(node.right, node),
";",
- ]);
+ ]),
+ );
}

Fix TS type formatting

Closes #460