Skip to content

Commit

Permalink
feat: Ensure TypeScript instantiation expressions can be parsed (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Aug 2, 2022
1 parent d82eb7a commit 0d92140
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .changeset/heavy-rockets-guess.md
@@ -0,0 +1,7 @@
---
"types-react-codemod": minor
---

Ensure TypeScript instantiation expressions can be parsed

[Instantiation expressions](https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#instantiation-expressions) were added in TypeScript 4.7.
9 changes: 9 additions & 0 deletions transforms/utils/__tests__/parseSync.js
Expand Up @@ -11,4 +11,13 @@ describe("parseSync", () => {
})
).not.toThrow();
});

test("TSInstantiationExpression", () => {
expect(() =>
parseSync({
path: "test.ts",
source: `const makeStringBox = makeBox<string>;`,
})
).not.toThrow();
});
});

0 comments on commit 0d92140

Please sign in to comment.