Skip to content

Commit

Permalink
Whitelist #region comments
Browse files Browse the repository at this point in the history
  • Loading branch information
DickvdBrink committed Aug 22, 2014
1 parent 00cb772 commit a3465c4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/rules/commentFormatRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ class CommentWalker extends Lint.RuleWalker {
return true; // comment is "//"? Technically not a violation.
}

// whitelist //#region and //#endregion
if ((/^#(end)?region/).test(commentText.substring(2))) {
return true;
}

var firstCharacter = commentText.charAt(2); // first character after the space
// three slashes (///) also works, to allow for ///<reference>
return firstCharacter === " " || firstCharacter === "/";
Expand Down
3 changes: 3 additions & 0 deletions test/files/rules/comment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ class Clazz { // this comment is correct
}
/// <reference or something>
}

//#region test
//#endregion

0 comments on commit a3465c4

Please sign in to comment.