Skip to content
This repository has been archived by the owner on Dec 17, 2023. It is now read-only.

Commit

Permalink
fix(core): Fix line number logic
Browse files Browse the repository at this point in the history
  • Loading branch information
nadeesha committed May 27, 2020
1 parent f8eb5b9 commit 9d0457d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/analyzer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ const nodeHandlers = {
};

const mustIgnore = (symbol: Symbol, file: SourceFile) => {
const symbolLinePos = symbol.getDeclarations().map(decl => decl.getStartLinePos()).reduce((currentMin, current) => Math.min(currentMin, current));
const symbolLinePos = symbol.getDeclarations().map(decl => decl.getStartLinePos()).reduce((currentMin, current) => Math.min(currentMin, current), Infinity);
const possibleIgnoreLinePos = symbolLinePos - ignoreComment.length;
return file.getDescendantAtPos(possibleIgnoreLinePos)?.getText().includes(ignoreComment);
}

const lineNumber = (symbol: Symbol) =>
symbol.getDeclarations().map(decl => decl.getStartLineNumber()).reduce((currentMin, current) => Math.min(currentMin, current))
symbol.getDeclarations().map(decl => decl.getStartLineNumber()).reduce((currentMin, current) => Math.min(currentMin, current), Infinity)

function getExported(file: SourceFile) {
return file.getExportSymbols()
Expand Down

0 comments on commit 9d0457d

Please sign in to comment.