[function-call-argument-newline] doesn't handle newlines inside arguments properly #12419
Labels
archived due to age
This issue has been archived; please open a new issue for any further discussion
bug
ESLint is working incorrectly
triage
An ESLint team member will look at this issue soon
Tell us about your environment
What parser (default, Babel-ESLint, etc.) are you using?
@typescript-eslint/parser
Please show your full configuration:
Here it is, just uncomment the "function-call-argument-newline" rule.
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
npx eslint src --ext '.ts, .tsx'
What did you expect to happen?
No error detected.
What actually happened? Please include the actual, raw output from ESLint.
I think ESLint is kind of considering a newline inside an argument (inside the body of the passed arrow function in this case) as a newline between arguments, which is what should trigger this rule IMHO.
As a result of this misbehavior the first call to
fn
is fine but the second one is not.Also this is a fairly common pattern to write when passing a dependency array to a React hook, so this would probably affect a lot of people.
Are you willing to submit a pull request to fix this bug?
I'm not too familiar with the AST, but with some pointers perhaps I can help.
The text was updated successfully, but these errors were encountered: