[Change request] valid-jsdoc's matchDescription should support multiple regular expressions and different error messages for each.
See original GitHub issuecurrently matchDescription accepts a regexp and throws an error message of “JSDoc description does not satisfy the regex pattern.”
Instead, I suggest it will accept a few regexpes, and will allow for different error messages. For example:
"valid-jsdoc": [
"error",
{
"matchDescription": {
".+": "Missing JSDoc description.",
"^\\s*[A-Z]": "JSDoc description should start with an uppercase letter.",
"\\.\\s*$": "JSDoc description must end with a period.",
"^(?![\\s\\S]*?\\.\\s*[a-z]).*$": "Sentence in JSDoc description must start with an uppercase letter."
}
}
]
This will allow for a greater usability of the matchDescription option.
If it’s not a priority for the team, I can open a pull request myself, as my project needs it. If this would not get accepted, I will write a rule with the same behavior for my project anyway.
Edit: forgot to mention, it would also be nice to have an option to apply these to param descriptions. Such that we can check they start with an hyphen, end with a period, etc.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:6 (5 by maintainers)
Top Results From Across the Web
REGEX - How to match and search any pattern or validate ...
You can download InterBase here: https://bit.ly/InterBase_DownloadI'll teach you the most important regex concepts, so after watching the ...
Read more >Regular expression syntax cheatsheet - JavaScript | MDN
This page provides an overall cheat sheet of all the capabilities of RegExp syntax by aggregating the content of the articles in the...
Read more >Everything you need to know about Regular Expressions
After reading this article you will have a solid understanding of what regular expressions are, what they can do, and what they can't...
Read more >Quantifiers in Regular Expressions - Microsoft Learn
Learn about regular expression quantifiers, which specify how many instances of a character, group, or character class must be present in ...
Read more >Regular Expressions
Okay, in many programming languages, a regular expression is a pattern that ... some internal form that can be used for super fast...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the suggestion. As of yesterday, we have decided to officially end-of-life JSDoc support in ESLint. All JSDoc features are now deprecated and we won’t be fixing bugs or making any further improvements to those features.
We are recommending that people transition over to use the
eslint-plugin-jsdoc
plugin instead of the built-in rules in ESLint.Thanks for understanding and we apologize for any inconvenience.
Removing myself as champion due to lack of general interest in this issue from the team and the community.