Skip to content

Commit

Permalink
fix(no-bad-blocks): avoid erring with /* */ comment
Browse files Browse the repository at this point in the history
  • Loading branch information
brettz9 committed Jan 3, 2021
1 parent fb906de commit 4e6c73d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -6682,6 +6682,8 @@ function quux () {
/* @ts-nocheck */
/* */
/* @custom */
// Options: [{"ignore":["custom"]}]
````
Expand Down
2 changes: 1 addition & 1 deletion src/rules/noBadBlocks.js
Expand Up @@ -25,7 +25,7 @@ export default iterateJsdoc(({
return false;
}

const [{tags}] = commentParser(`${commentText.slice(0, 2)}*${commentText.slice(2)}`);
const [{tags = {}} = {}] = commentParser(`${commentText.slice(0, 2)}*${commentText.slice(2)}`);

return tags.length && !tags.some(({tag}) => {
return ignore.includes(tag);
Expand Down
3 changes: 3 additions & 0 deletions test/rules/assertions/noBadBlocks.js
Expand Up @@ -156,6 +156,9 @@ export default {
{
code: '/* @ts-nocheck */',
},
{
code: '/* */',
},
{
code: '/* @custom */',
options: [{ignore: ['custom']}],
Expand Down

0 comments on commit 4e6c73d

Please sign in to comment.