Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: benjamn/recast
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.23.10
Choose a base ref
...
head repository: benjamn/recast
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.23.11
Choose a head ref
  • 3 commits
  • 4 files changed
  • 2 contributors

Commits on Nov 25, 2024

  1. Verified

    This commit was signed with the committer’s verified signature.
    alestiago Alejandro Santiago
    Copy the full SHA
    539b8d3 View commit details

Commits on Mar 3, 2025

  1. Merge pull request #1415 from spanishpear/master

    Feat: support Typescript type arguments on tagged template literals
    eventualbuddha authored Mar 3, 2025

    Verified

    This commit was signed with the committer’s verified signature.
    alestiago Alejandro Santiago
    Copy the full SHA
    23af451 View commit details
  2. 0.23.11

    eventualbuddha committed Mar 3, 2025

    Verified

    This commit was signed with the committer’s verified signature.
    alestiago Alejandro Santiago
    Copy the full SHA
    04650eb View commit details
Showing with 17 additions and 4 deletions.
  1. +6 −1 lib/printer.ts
  2. +2 −2 package-lock.json
  3. +1 −1 package.json
  4. +8 −0 test/typescript.ts
7 changes: 6 additions & 1 deletion lib/printer.ts
Original file line number Diff line number Diff line change
@@ -1587,7 +1587,12 @@ function genericPrintNoParens(path: any, options: any, print: any) {
}

case "TaggedTemplateExpression":
return concat([path.call(print, "tag"), path.call(print, "quasi")]);
parts.push(path.call(print, "tag"));
if (n.typeParameters) {
parts.push(path.call(print, "typeParameters"));
}
parts.push(path.call(print, "quasi"));
return concat(parts);

// These types are unprintable because they serve as abstract
// supertypes for other (printable) types.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"author": "Ben Newman <bn@cs.stanford.edu>",
"name": "recast",
"version": "0.23.10",
"version": "0.23.11",
"description": "JavaScript syntax tree transformer, nondestructive pretty-printer, and automatic source map generator",
"keywords": [
"ast",
8 changes: 8 additions & 0 deletions test/typescript.ts
Original file line number Diff line number Diff line change
@@ -331,6 +331,14 @@ const nodeMajorVersion = parseInt(process.versions.node, 10);
check(["type Class<T> = new (...args: any) => T;"]);

check(["type T1 = [...Array<any>];", "type T2 = [...any[]];"]);
check([
"const a = styled.h1<{",
" $upsideDown?: boolean;",
"}>`",
' ${props => props.$upsideDown && "transform: rotate(180deg);"}',
" text-align: center;",
"`;",
]);

check([
"type Color = [r: number, g: number, b: number, a?: number];",