Skip to content

Commit

Permalink
fix: errors not being displayed in the correct files (#700)
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelss95 authored and mgechev committed Aug 13, 2018
1 parent 22de2a6 commit db3cf5a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
14 changes: 4 additions & 10 deletions src/angular/ngWalker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down
7 changes: 2 additions & 5 deletions src/noUnusedCssRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
}

0 comments on commit db3cf5a

Please sign in to comment.