diff --git a/types/eslint/eslint-tests.ts b/types/eslint/eslint-tests.ts index b0c3c1966d..c6b8b786fa 100644 --- a/types/eslint/eslint-tests.ts +++ b/types/eslint/eslint-tests.ts @@ -62,7 +62,9 @@ sourceCode.getNodeByRangeIndex(0); sourceCode.isSpaceBetweenTokens(TOKEN, TOKEN); -sourceCode.getLocFromIndex(0); +const loc = sourceCode.getLocFromIndex(0); +loc.line; // $ExpectType number +loc.column; // $ExpectType number sourceCode.getIndexFromLoc({ line: 0, column: 0 }); diff --git a/types/eslint/index.d.ts b/types/eslint/index.d.ts index 031ab984f7..451477af40 100644 --- a/types/eslint/index.d.ts +++ b/types/eslint/index.d.ts @@ -136,7 +136,7 @@ export class SourceCode { isSpaceBetweenTokens(first: AST.Token, second: AST.Token): boolean; - getLocFromIndex(index: number): ESTree.SourceLocation; + getLocFromIndex(index: number): ESTree.Position; getIndexFromLoc(location: ESTree.Position): number;