Skip to content

Commit

Permalink
docs(match-description): provide sample with catching leading white…
Browse files Browse the repository at this point in the history
…space
  • Loading branch information
brettz9 committed Mar 11, 2022
1 parent a31a8fd commit 13f128b
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7161,6 +7161,16 @@ function quux () {
}
// "jsdoc/match-description": ["error"|"warn", {"matchDescription":"[\\s\\S]*\\S$"}]
// Message: JSDoc description does not satisfy the regex pattern.

/**
*
* This function does lots of things.
*/
function quux () {

}
// "jsdoc/match-description": ["error"|"warn", {"matchDescription":"^\\S[\\s\\S]*\\S$"}]
// Message: JSDoc description does not satisfy the regex pattern.
````

The following patterns are not considered problems:
Expand Down
22 changes: 22 additions & 0 deletions test/rules/assertions/matchDescription.js
Original file line number Diff line number Diff line change
Expand Up @@ -934,6 +934,28 @@ export default {
},
],
},
{
code: `
/**
*
* This function does lots of things.
*/
function quux () {
}
`,
errors: [
{
line: 3,
message: 'JSDoc description does not satisfy the regex pattern.',
},
],
options: [
{
matchDescription: '^\\S[\\s\\S]*\\S$',
},
],
},
],
valid: [
{
Expand Down

0 comments on commit 13f128b

Please sign in to comment.