Skip to content

Commit

Permalink
@types/eslint support non-ESTree sourceTypes
Browse files Browse the repository at this point in the history
  • Loading branch information
Logicer16 committed Jan 18, 2024
1 parent 27bd4f4 commit fbd4b70
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion types/eslint/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@ export namespace AST {

type Range = [number, number];

interface Program extends Omit<ESTree.Program, "body" | "comments"> {
interface Program extends Omit<ESTree.Program, "body" | "comments" | "sourceType"> {
comments?: Comment[] | undefined;
tokens?: Token[] | undefined;
loc?: SourceLocation | undefined;
range?: Range | undefined;

// Support non-ESTree nodes
body: Node[];
sourceType?: "script" | "module" | undefined
}

type ValidatedProgram = Required<Pick<AST.Program, "comments" | "tokens" | "loc" | "range">> & AST.Program;
Expand Down

0 comments on commit fbd4b70

Please sign in to comment.