Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Commit

Permalink
JSDoc rule should not block arbitrary comments like /********/ (#1543)
Browse files Browse the repository at this point in the history
  • Loading branch information
nomaed authored and jkillian committed Sep 10, 2016
1 parent eca8ac7 commit e9bedf9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rules/jsdocFormatRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ class JsdocWalker extends Lint.SkippableTokenAwareRuleWalker {
const firstLine = lines[0];
let jsdocPosition = currentPosition;

// regex is: start of string, followed by any amount of whitespace, followed by /**
const isJsdocMatch = firstLine.match(/^\s*\/\*\*/);
// regex is: start of string, followed by any amount of whitespace, followed by /** but not more than 2 **
const isJsdocMatch = firstLine.match(/^\s*\/\*\*([^*]|$)/);
if (isJsdocMatch != null) {
if (lines.length === 1) {
const firstLineMatch = firstLine.match(/^\s*\/\*\* (.* )?\*\/$/);
Expand Down
4 changes: 4 additions & 0 deletions test/rules/jsdoc-format/jsdoc.ts.lint
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ I've even got characters where I shouldn't. How fun! *
*/
}

/**********************************************************/
/* this is just an arbitrary separator, not a jsdoc block */
/**********************************************************/

/**
* this is also jsdoc
*and it has a problem on this line
Expand Down

0 comments on commit e9bedf9

Please sign in to comment.