mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-07 00:07:07 +00:00
Fix commentsExistBetween signature and make parse return Program
This commit is contained in:
@@ -209,6 +209,7 @@ sourceCode.getTokens(AST, { includeComments: true });
|
||||
sourceCode.getTokens(AST, { includeComments: true, filter: t => t.type === 'Identifier' });
|
||||
|
||||
sourceCode.commentsExistBetween(AST, AST);
|
||||
sourceCode.commentsExistBetween(TOKEN, TOKEN);
|
||||
|
||||
sourceCode.getCommentsBefore(AST);
|
||||
sourceCode.getCommentsBefore(TOKEN);
|
||||
|
||||
Vendored
+2
-2
@@ -193,7 +193,7 @@ export class SourceCode {
|
||||
getTokens(node: ESTree.Node, beforeCount?: number, afterCount?: number): AST.Token[];
|
||||
getTokens(node: ESTree.Node, options: SourceCode.FilterPredicate | SourceCode.CursorWithCountOptions): AST.Token[];
|
||||
|
||||
commentsExistBetween(left: ESTree.Node, right: ESTree.Node): boolean;
|
||||
commentsExistBetween(left: ESTree.Node | AST.Token, right: ESTree.Node | AST.Token): boolean;
|
||||
|
||||
getCommentsBefore(nodeOrToken: ESTree.Node | AST.Token): ESTree.Comment[];
|
||||
|
||||
@@ -433,7 +433,7 @@ export namespace Linter {
|
||||
}
|
||||
|
||||
type ParserModule = {
|
||||
parse(text: string, options?: any): ESTree.Node;
|
||||
parse(text: string, options?: any): AST.Program;
|
||||
} | {
|
||||
parseForESLint(text: string, options?: any): ESLintParseResult;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user