eslint: comma-dangle doesn't report functions when using string option
Tell us about your environment
- ESLint Version: 6.1.0
- Node Version: 12.7.0
- npm Version: 6.10.2
What parser (default, Babel-ESLint, etc.) are you using? default
Please show your full configuration:
Configuration
{
"comma-dangle": ["error", "always"]
}
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
foo(a)
What did you expect to happen?
I expected it to warn about the missing trailing comma after a
. This is true no matter which string option I’m using. I saw that comma-dangle
changed in 6.0.0
so I’m guessing it has something to do with that.
What actually happened? Please include the actual, raw output from ESLint. No errors were reported.
Are you willing to submit a pull request to fix this bug? Yes
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 22 (11 by maintainers)
It’s unfortunate that it causes a lot more errors, but I do think this was the intended behavior and is a bug that should be fixed.
I would be okay with reverting the change in semver-patch and deferring to semver-major, personally. I don’t think this level of breakage was intended (at least, I wasn’t intending it).
Probably best to add this to the TSC’s agenda.
@mojavelinux Could you please open a new issue, so we can track this more easily? Thanks!
@mojavelinux yes, the configuration should be something like this:
The change for this issue broke my eslint config. I use the following config:
Now it reports that I’m missing a trailing comma for every function. Do I need to update my configuration to retain the previous rule?
Maybe @aladdin-add can clarify this for us. It looks like maybe this line should be changed to match the change in this PR.