Skip to content

Commit

Permalink
fix(match-description): while preserving internal newlines, ensure …
Browse files Browse the repository at this point in the history
…trailing whitespace is stripped for comparisons; for #692
  • Loading branch information
brettz9 committed Feb 16, 2021
1 parent d682f1f commit 27b95b3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/rules/matchDescription.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default iterateJsdoc(({
if (jsdoc.description) {
const {description} = utils.getDescription();
validateDescription(
description.replace(/\n+$/, ''),
description.replace(/\s+$/, ''),
);
}

Expand Down
12 changes: 12 additions & 0 deletions test/rules/assertions/matchDescription.js
Original file line number Diff line number Diff line change
Expand Up @@ -1339,5 +1339,17 @@ export default {
},
}],
},

// https://github.com/gajus/eslint-plugin-jsdoc/issues/692#issuecomment-780081285
{
code: `
/** Wrap attributes threshold. */
const quux = {};
`,
ignoreReadme: true,
options: [{
contexts: ['any'],
}],
},
],
};

0 comments on commit 27b95b3

Please sign in to comment.