Skip to content

Commit

Permalink
fix(ngWhitespace): better error message & proper rule name
Browse files Browse the repository at this point in the history
  • Loading branch information
mgechev committed Jun 16, 2017
1 parent 64fc135 commit faeff38
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/angularWhitespaceRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ class InterpolationWhitespaceVisitor extends BasicTemplateAstVisitor implements
let error = null;
const expr: any = (<any>text.value).source;
if (InterpolationNoWhitespaceRe.test(expr)) {
error = 'Missing whitespace in interpolation; expecting {{ expr }}';
error = `Missing whitespace in interpolation; expecting ${InterpolationOpen} expr ${InterpolationClose}`;
}
if (InterpolationExtraWhitespaceRe.test(expr)) {
error = 'Extra whitespace in interpolation; expecting {{ expr }}';
error = `Extra whitespace in interpolation; expecting ${InterpolationOpen} expr ${InterpolationClose}`;
}
if (error) {
const internalStart = expr.indexOf(InterpolationOpen);
Expand Down Expand Up @@ -157,7 +157,7 @@ class TemplateExpressionVisitor extends RecursiveAngularExpressionVisitor {

export class Rule extends Lint.Rules.AbstractRule {
public static metadata: Lint.IRuleMetadata = {
ruleName: 'angular-whitespace-rule',
ruleName: 'angular-whitespace',
type: 'style',
description: `Ensures the proper formatting of Angular expressions.`,
rationale: `Having whitespace in the right places in an Angular expression makes the template more readable.`,
Expand Down

0 comments on commit faeff38

Please sign in to comment.