Fix commentsExistBetween signature and make parse return Program

This commit is contained in:
Pierre-Marie
2018-02-04 08:01:41 -08:00
parent 25d95f9e69
commit f2ce6a9bb4
2 changed files with 3 additions and 2 deletions
+1
View File
@@ -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);
+2 -2
View File
@@ -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;
};