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

Allow "any" to rules with contexts #325

Closed
brettz9 opened this issue Jul 9, 2019 · 4 comments · Fixed by #462
Closed

Allow "any" to rules with contexts #325

brettz9 opened this issue Jul 9, 2019 · 4 comments · Fixed by #462

Comments

@brettz9
Copy link
Collaborator

brettz9 commented Jul 9, 2019

For rules with a contexts option (match-description, require-example, require-description, and require-jsdoc), though one may not wish these applied to all contexts, there are nevertheless cases for doing so, particularly for the first, and less so for the second, but even potentially for the others.

I'd like to see us allow an "any" option or allowing contexts to be set to true to indicate all contexts.

Update: In my PR, I decided against adding for require-jsdoc, as it would require separate refactoring, and probably not worth the effort for that particular rule.

@golopot
Copy link
Collaborator

golopot commented Jul 9, 2019

Setting context to "all" means that require-example will apply to file-level jsdoc, ESNext class fields, and variable declarations. I don't think people will want that.

As for match-description, it seems that it should be applied to all jsdoc comments.

@brettz9
Copy link
Collaborator Author

brettz9 commented Jul 9, 2019

Yes, I agree require-example is unlikely at that level, but since we're using the same code for it, I don't think it'd hurt to allow it, as with require-jsdoc for which it would be similarly unlikely. But definitely an option for require-description.

And as we previously discussed, I do think there ought to remain separate levels of control for match-description because it is styling that one might not care to enforce outside of certain contexts like functions. match-description already allows contexts, so I'd like match-description to accept any.

@golopot
Copy link
Collaborator

golopot commented Jul 9, 2019

That sounds reasonable, I am good with this.

brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Dec 28, 2019
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Dec 28, 2019
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Dec 29, 2019
* any-contexts:
  feat(match-description, require-description, require-example): allow "any" for contexts; fixes gajus#325

# Conflicts:
#	src/iterateJsdoc.js
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Dec 29, 2019
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Dec 29, 2019
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Dec 29, 2019
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Dec 29, 2019
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Dec 29, 2019
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Dec 29, 2019
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Dec 31, 2019
brettz9 added a commit that referenced this issue Dec 31, 2019
@gajus
Copy link
Owner

gajus commented Dec 31, 2019

🎉 This issue has been resolved in version 18.11.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants