Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom message for match-description #688

Closed
simonseyock opened this issue Feb 4, 2021 · 3 comments · Fixed by #756
Closed

Custom message for match-description #688

simonseyock opened this issue Feb 4, 2021 · 3 comments · Fixed by #756

Comments

@simonseyock
Copy link
Contributor

simonseyock commented Feb 4, 2021

Motivation

It would be great if it would be possible to pass a custom message to the match-description rule. This way the error message becomes more descriptive.

Current behavior

If I use for example the following rule:

{
  'jsdoc/match-description': ['error', {matchDescription: '[A-Z].*\\.'}]
}

I get the validation error JSDoc description does not satisfy the regex pattern

Desired behavior

I would like to specify a custom message that fits to my regex pattern. In this specific example it might be something like this:

{
  'jsdoc/match-description': ['error', {
     matchDescription: '[A-Z].*\\.',
     message: 'All descriptions have to start with an uppercase letter and end with a dot.'
  }]
}
@simonseyock
Copy link
Contributor Author

And by the way matchDescription: '^\\s*[A-Z][\\s\\S]*\\.$' might be better suited as an example in readme 😁

@brettz9
Copy link
Collaborator

brettz9 commented Feb 21, 2021

Any PR to add such support would I think also need to add a message capability with individual tags and for mainDescription.

brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Jun 19, 2021
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Jun 20, 2021
@gajus
Copy link
Owner

gajus commented Jun 21, 2021

🎉 This issue has been resolved in version 35.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@gajus gajus added the released label Jun 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants