Bug report: Comma dangle always throw error
See original GitHub issueTell us about your environment
- ESLint Version: v3.12.2
- Node Version: v6.9.1
- npm Version: 4.0.5
What parser (default, Babel-ESLint, etc.) are you using?
default
Please show your full configuration:
{
"globals": {},
"env": {},
"rules": {
"comma-dangle": [
"error",
{
"arrays": "always-multiline",
"objects": "always-multiline",
"imports": "always-multiline",
"exports": "always-multiline",
"functions": "always-multiline"
}
]
},
"parserOptions": {}
}
What did you do? Please include the actual source code causing the issue.
console.log(
'a'
);
What did you expect to happen?
$> eslint a.js
# No error
What actually happened? Please include the actual, raw output from ESLint.
mondwan@mondwan-All-Series:~/Documents/codeTest/babelEslint$ eslint --print-config .
{
"globals": {},
"env": {},
"rules": {
"comma-dangle": [
"error",
{
"arrays": "always-multiline",
"objects": "always-multiline",
"imports": "always-multiline",
"exports": "always-multiline",
"functions": "always-multiline"
}
]
},
"parserOptions": {}
}
mondwan@mondwan-All-Series:~/Documents/codeTest/babelEslint$ cat a.js
console.log(
'a'
);
mondwan@mondwan-All-Series:~/Documents/codeTest/babelEslint$ eslint a.js
/home/mondwan/Documents/codeTest/babelEslint/a.js
2:5 error Missing trailing comma comma-dangle
✖ 1 problem (1 error, 0 warnings)
Issue Analytics
- State:
- Created 7 years ago
- Comments:27 (19 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 >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 >ESLint - ESLint - Breword 文档集合
A bug fix in a rule that results in ESLint reporting fewer linting errors. · A bug fix to the CLI or core...
Read more >Trailing comma in ECMAScript 2017 function parameter list
Object and array literals allow us to leave a comma dangling off the final ... the implementation in IE8 and below is a...
Read more >Code Issues - Embold Help Center
Similarly, any defect or bug found in the code leads to code issues. ... When comma is used in a return statement it...
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
I don’t have a position (yet) on attempting to parse. I was only trying to clarify what I was asking @not-an-aardvark the whole time 😄
I could get behind a messaging change that mentions when dangling commas in functions are actually valid. @not-an-aardvark Thoughts?