dangling comma vs. newline paren in 12.
See original GitHub issueIn eslint-config-airbnb-base
version 11.3.0, this was ok:
const addFrameworkSoapHeader = soapClient =>
soapClient.addSoapHeader(
{ Security: 'wsse' },
'frameworksecurity',
'wsse',
'http://schemas.xmlsoap.org/ws/2002/07/secext');
In version 12.0.0, you get in this circular loop. The above code says parens must be on new line, so it becomes:
...
'http://schemas.xmlsoap.org/ws/2002/07/secext'
);
However, if you do that, you get yelled at for no dangling comma. So if you add that:
...
'http://schemas.xmlsoap.org/ws/2002/07/secext',
);
Then ESLint abandons the whole file because of a parsing issue with the extra paren:
Parsing error: Unexpected token )
For now, we’ve locked version in our package.json to 11.3.0.
Issue Analytics
- State:
- Created 6 years ago
- Comments:11
Top Results From Across the Web
comma-dangle always-multiline should only count newlines ...
The new always-multiline behavior of comma-dangle requires a trailing comma if a newline appears anywhere in the literal.
Read more >Trailing commas - JavaScript - MDN Web Docs
Trailing commas (sometimes called "final commas") can be useful when adding new elements, parameters, or properties to JavaScript code.
Read more >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 adding a trailing comma after an expression create ...
It is the commas, not the parentheses, which are significant. The Python tutorial says: A tuple consists of a number of values separated...
Read more >jsonc/comma-dangle | eslint-plugin-jsonc
This rule enforces consistent use of trailing commas in object and array literals. 1. 2. 3. 4. 5. 6. 7. 8. 9. 10....
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
@ljharb You rock, thanks man!
thanks @ljharb, interesting. I always assumed that your style guide was always opinionated towards modern syntax of ES. So that if these rules are followed, and you use a modern version of Node, it would always work.
Totally understand from the client perspective. I shall add transpiling to my server side work flow from now on!