-
Notifications
You must be signed in to change notification settings - Fork 26.8k
(question) eslint rule / plugin for guideline 7.15 #1731
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
Comments
Indeed!
|
awesome! thanks @ljharb. i can't seem to find the right options for in particular, i can't get eslint to bug me about the 'bad' example below.
|
Maybe we need to file something upstream on eslint about it? |
@shelbyspeegle I tried both rules out and I'm getting both errors, the bad example included.
What have you tried so far? |
thanks @raunofreiberg, that gets me close, unfortunately it allows these scenarios:
i assumed that this should produce an eslint error, but an example isnt provided for this type of case. i did see this in the guide language that could suggest that this should error.
|
Yes, that should be an error. Either the entire invocation fits on one line, or each argument is on a line by itself. |
Doesn't the "multiline" option on function-paren-newline along with the current "comma-dangle" implement 7.15 correctly? If so, this line should be updated. Edit: I can open a PR, but I want to verify this is correct first. Also, I think it should be "multiline-arguments" not "multiline" so as to allow line breaks before and after argument lists with a single item. |
Reading the rule docs, it does seem like It was changed from "multiline" to "consistent" in 2018. eslint itself added I'm hesitant to make this change, however, until it's at least been verified on airbnb's own code. I'll reach out to folks there and see how it goes. |
Given that this rule is disabled by eslint-config-prettier, Airbnb won't be affected, so I think this is a reasonable semver-minor change to make. @GusBuonv please make that PR :-) |
@ljharb Done! If the PR is merged, it may still be a good idea to keep this issue open or open a new one. I assume 7.15 is also supposed to apply to argument destructuring. If it is meant to apply in this case, it is still not properly enforced, and current core ESLint rules don't provide a way to achieve the desired behavior. |
…`multiline-arguments` option Related to airbnb#1731
…`multiline-arguments` option Related to airbnb#1731 Co-authored-by: Augustus Buonviri <[email protected]> Co-authored-by: Jordan Harband <[email protected]>
is there an eslint rule or plugin that enforces 7.15?
The text was updated successfully, but these errors were encountered: