diff --git a/README.md b/README.md index 3db2b2e30..6473d0924 100644 --- a/README.md +++ b/README.md @@ -6682,6 +6682,8 @@ function quux () { /* @ts-nocheck */ +/* */ + /* @custom */ // Options: [{"ignore":["custom"]}] ```` diff --git a/src/rules/noBadBlocks.js b/src/rules/noBadBlocks.js index fcb92b65b..c2a850ad2 100644 --- a/src/rules/noBadBlocks.js +++ b/src/rules/noBadBlocks.js @@ -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); diff --git a/test/rules/assertions/noBadBlocks.js b/test/rules/assertions/noBadBlocks.js index 77ad6af81..d290dc2d4 100644 --- a/test/rules/assertions/noBadBlocks.js +++ b/test/rules/assertions/noBadBlocks.js @@ -156,6 +156,9 @@ export default { { code: '/* @ts-nocheck */', }, + { + code: '/* */', + }, { code: '/* @custom */', options: [{ignore: ['custom']}],