Skip to content

Type errors with TypeScript 5.4+ #948

@freben

Description

@freben

When upgrading to TypeScript 5.4+, importing from ast-types leads to type errors.

Reproduction:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions