From ab654c0c94136710cb8681fd88c55602e8d30fbf Mon Sep 17 00:00:00 2001 From: Rafael Date: Mon, 13 Aug 2018 00:24:26 -0300 Subject: [PATCH] fix: errors not being displayed in the correct files --- src/angular/ngWalker.ts | 14 ++++---------- src/noUnusedCssRule.ts | 7 ++----- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/angular/ngWalker.ts b/src/angular/ngWalker.ts index 8f8ec059c..d8c019be6 100644 --- a/src/angular/ngWalker.ts +++ b/src/angular/ngWalker.ts @@ -205,11 +205,8 @@ export class NgWalker extends Lint.RuleWalker { compiler.templateVisitAll(referenceVisitor, roots, null); visitor._variables = referenceVisitor.variables; roots.forEach(r => visitor.visit(r, context.controller)); - visitor - .getFailures() - .forEach(f => - this.addFailureFromStartToEnd(f.getStartPosition().getPosition(), f.getEndPosition().getPosition(), f.getFailure(), f.getFix()) - ); + // tslint:disable-next-line:deprecation + visitor.getFailures().forEach(f => this.addFailure(f)); } protected visitNgStyleHelper(style: CssAst, context: ComponentMetadata, styleMetadata: StyleMetadata, baseStart: number) { @@ -220,11 +217,8 @@ export class NgWalker extends Lint.RuleWalker { const sourceFile = this.getContextSourceFile(styleMetadata.url!, styleMetadata.style.source!); const visitor = new this._config!.cssVisitorCtrl!(sourceFile, this._originalOptions, context, styleMetadata, baseStart); style.visit(visitor); - visitor - .getFailures() - .forEach(f => - this.addFailureFromStartToEnd(f.getStartPosition().getPosition(), f.getEndPosition().getPosition(), f.getFailure(), f.getFix()) - ); + // tslint:disable-next-line:deprecation + visitor.getFailures().forEach(f => this.addFailure(f)); } protected getContextSourceFile(path: string, content: string) { diff --git a/src/noUnusedCssRule.ts b/src/noUnusedCssRule.ts index 0651dd197..d90a6c72b 100644 --- a/src/noUnusedCssRule.ts +++ b/src/noUnusedCssRule.ts @@ -289,11 +289,8 @@ export class UnusedCssNgVisitor extends NgWalker { const encapsulation = getDecoratorPropertyInitializer(d, 'encapsulation'); if (isEncapsulationEnabled(encapsulation)) { style.visit(visitor); - visitor - .getFailures() - .forEach(f => - this.addFailureFromStartToEnd(f.getStartPosition().getPosition(), f.getEndPosition().getPosition(), f.getFailure(), f.getFix()) - ); + // tslint:disable-next-line:deprecation + visitor.getFailures().forEach(f => this.addFailure(f)); } } }