Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Commit 3c2596c

Browse files
committed
refactor(lint): remove toJson call from logger
1 parent fe06f53 commit 3c2596c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/logger/logger-tslint.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,17 @@ export function runTsLintDiagnostics(context: BuildContext, failures: RuleFailur
99
});
1010
}
1111

12+
function getPositonData(positionObject: any) {
13+
return {
14+
position: positionObject.position,
15+
line: positionObject.lineAndCharacter ? positionObject.lineAndCharacter.line : 0,
16+
character: positionObject.lineAndCharacter ? positionObject.lineAndCharacter.character : 0,
17+
};
18+
}
1219

1320
function loadDiagnostic(context: BuildContext, f: RuleFailure) {
14-
const start: RuleFailurePosition = f.startPosition.toJson();
15-
const end: RuleFailurePosition = f.endPosition.toJson();
21+
const start: RuleFailurePosition = getPositonData(f.startPosition);
22+
const end: RuleFailurePosition = getPositonData(f.endPosition);
1623

1724
const d: Diagnostic = {
1825
level: 'warn',

0 commit comments

Comments
 (0)