comma-dangle bug
See original GitHub issueTell us about your environment
- ESLint Version: v3.12.2
- Node Version: v6.9.1
- npm Version: 3.10.9
What parser (default, Babel-ESLint, etc.) are you using?
Please show your full configuration:
{
"extends": "airbnb",
"rules": {
"strict": 0,
"no-underscore-dangle": ["error", { "allow": ["__"] }],
"new-cap": ["error", { "capIsNew": false }],
"no-confusing-arrow": ["error", { "allowParens": true }]
},
"parserOptions": {
"ecmaVersion": 6,
"ecmaFeatures": {
"experimentalObjectRestSpread": true
}
}
}
What did you do? Please include the actual source code causing the issue.
const headers = R.compose(
R.assoc('X-Requested-With', 'XMLHttpRequest'),
R.merge({ 'Content-Type': 'application/json;charset=UTF-8' }),
R.defaultTo({})
)(header);
What did you expect to happen?
in the line of R.defaultTo({})
, should not output “comma-dangle” error
What actually happened? Please include the actual, raw output from ESLint. Missing trailing comma. (comma-dangle)
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
comma-dangle - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >Why does this trigger comma-dangle rule in eslint?
Based on the airbnb config the rule is setup like this comma-dangle: [2, "always-multiline"] . Acoording to this, The expected code is
Read more >How to Allow Trailing Commas (Comma-Dangle) With ...
Allowing comma-dangle in TypeScript requires two configurations in your ESLint setup. At first, you must turn off ESLint's default comma-dangle ...
Read more >comma-dangle with rest bug · Issue #7857 - GitHub
Thanks for the report, but this is working as intended -- trailing commas after rest properties are a syntax error. Also see: #7614,...
Read more >jsonc/comma-dangle | eslint-plugin-jsonc
Rule Details. This rule enforces consistent use of trailing commas in object and array literals. 1.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the report, however I believe this is working as intended. As far as I remember,
airbnb-base
uses the following config forcomma-dangle
, which means comma dangles will also be enforced for function invocations:If you don’t want to enforce trailing commas for functions invocations you should override the airbnb default config and turn off checking for functions:
@vitorbal @ilyavolodin , got it, I’ll close this issue.