ast-types icon indicating copy to clipboard operation
ast-types copied to clipboard

Type errors with TypeScript 5.4+

Open freben opened this issue 10 months ago • 1 comments

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: image

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";

freben avatar Apr 17 '24 11:04 freben