ast-types
ast-types copied to clipboard
Type errors with TypeScript 5.4+
When upgrading to TypeScript 5.4+, importing from ast-types
leads to type errors.
Reproduction:
- check out https://github.com/backstage/backstage/pull/24265
- run
yarn install
- run
yarn tsc:full
Result:
Obeying the instructions and explicitly making them type imports solves the problem:
-import { ASTNode, Type, AnyType, Field } from "./lib/types";
+import { ASTNode, type Type, AnyType, Field } from "./lib/types";
-import { NodePath } from "./lib/node-path";
+import { type NodePath } from "./lib/node-path";
-import { builders } from "./gen/builders";
+import { type builders } from "./gen/builders";