-
-
Notifications
You must be signed in to change notification settings - Fork 159
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
Missing fixers #336
Comments
…o nothing with missing description); fixes part of gajus#336
…o nothing with missing description); fixes part of gajus#336
@yeonjuan : Would you mind submitting a PR with:
/**
* @param foo
* @param baz
*/
function quux (foo, bar, baz) {
}
function quux (foo, {bar, baz}) {
} Lastly, while I wouldn't expect this now, particularly if we add destructuring support (#11), I just thought I'd mention here that it would be nice to have an option to auto-insert some configurable value like /**
* @param foo
* @param cfg
* @param cfg.bar
* @param cfg.baz
*/
function quux (foo, {bar, baz}) {
} |
I brought up in #404 the idea of our going forward to have the fixers apply all fixes in one go (as with that PR) despite eslint running multiple fix passes for us, with the reason being that the eslint testing framework only shows While I can understand an argument for not changing code to suit testing quirks, I think it is advantageous in our case to do things this way, since our documentation is built on the tests, and I think we all agree we don't want to mislead users into which items are fixed or not. And I am not aware of any advantages to expressing rules such that they can be used to make only one fix of a given problem. Any thoughts on this, @gajus ? |
Another advantage of doing so for us would be that we should be more likely to catch recursive errors such as #403 . |
@brettz9 Everything you said makes sense. |
For cases where multiple types of fixing may be desirable, we can use "suggestions": https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions |
I think the require-returns fixer is not also missing, is it possible to add it to the list ? Or am I mistaken ? |
@vlafranca : Added, thanks! |
The following can have fixers added, with some fixers being by option only:
check-examples
(for rules that have fixers)check-indentation
check-param-names
(jsdoc/check-param-names
should be fixable if order is wrong #47)check-syntax
(add optional param brackets instead)implements-on-classes
- Option to strip tag or change to@type
match-description
fixers? allow arbitraryno-types
(removes types)no-undefined-types
(optionally auto-create typedef skeleton);require-description
(fix the missing declaration if opted for "tag" option, i.e., insisting on@description
)require-description-complete-sentence
(optionally add period at end of previous line and per require-description-complete-sentence false positives #337, add option to avoid triggering at all; make other fixing optional per require-description-complete-sentence false positives #337 ).require-example
(fix the missing tag declaration)require-jsdoc
(adds an empty docblock)require-param-name
(add the name/default for each jsdoc param and whether optional)require-param-type
(optionally add curly brackets for each jsdoc param so one only need to add the type)require-param
(add the tag; add name to docs if present in the signature)require-returns
(To facilitate such fixer work, we can use the new
stringify
method of https://github.com/yavorskiy/comment-parser/ which allows stringifying (modified) comment-parser JSON back to a string.)As per #408 these fixers should apply recursively (as with existing ones).
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: