-
-
Notifications
You must be signed in to change notification settings - Fork 166
match-description options #294
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
Conversation
src/rules/matchDescription.js
Outdated
matchDescription: { | ||
format: 'regex', | ||
type: 'string' | ||
}, | ||
noDefaults: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this option? Isn't it more intuitive to let provided contexts
to override the default context
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is extra work for users. I believe people will almost always want to keep the defaults. Also, that is the existing behavior for require-description
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this option? Isn't it more intuitive to let provided contexts to override the default context?
Agreed. Otherwise, I need to be aware of what the defaults are. contexts
should just override the default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There have been a few rules already added using this approach, e.g., require-description
, check-types
. Revert them as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(check-types
is somewhat different in referring to avoid the defaults for your preferred types, while require-description
is more like as in this PR.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went ahead and added a commit to make a breaking change to remove noDefaults
from require-description
(and for match-description
) though I haven't done so for check-types
unless you want to confirm. Let me know if that is ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gajus : Since your approval kind of overlapped with my reversion, I just wanted to confirm--are you happy with my breaking change to undo require-description
's use of noDefaults
(in addition to removing it in match-description
)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer not providing the option contexts
, why would you want to include or exclude some node type?
|
I mean the rule should apply to all jsdoc without exception (#214). |
I think it is better to be under user control, whether for performance or just because projects differ from one another in their needs; but if you want to expand the defaults, I can change to support all node types by default. |
src/rules/matchDescription.js
Outdated
matchDescription: { | ||
format: 'regex', | ||
type: 'string' | ||
}, | ||
noDefaults: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this option? Isn't it more intuitive to let provided contexts to override the default context?
Agreed. Otherwise, I need to be aware of what the defaults are. contexts
should just override the default.
In the future please keep unrelated changes in different pull requests. Stuffing all changes in a pr 1) makes it much harder to review, 2) make the reviewer unable to accept one part of change and reject another. |
This PR has now been narrowed somewhat, and I think it is ready for merging, @gajus , if you could respond to my comments ending at #294 (comment) mentioning how I added a breaking change that I understood you wanted around the time you approved this PR, so I wanted to confirm that breaking change was indeed ok. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Would you like to rebase the commits? The commit history of master can be less noisy. Also allows sematic-release to generate proper release notes.
If y'all are ready for rebasing, sure. |
d718c34
to
91344a4
Compare
…ple errors when main description validation fails
…at the end even if only a single character
… with any node type
…rride or disable main description separate from default
…change `contexts` to always override defaults
…`ClassExpression` and `ObjectExpression`
…uire-jsdoc); docs, schema
91344a4
to
2c34e21
Compare
🎉 This PR is included in version 9.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
noDefaults
option and changecontexts
to always override defaultsmainDescription: string|boolean
to override or disable main description separate from defaultcontexts
options for control on which contexts the rules applymatch-description
contexts
option to allow working with any node typecontexts
to work with any node type