question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug report: Comma dangle always throw error

See original GitHub issue

Tell 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:closed
  • Created 7 years ago
  • Comments:27 (19 by maintainers)

github_iconTop GitHub Comments

1reaction
platinumazurecommented, Dec 26, 2016

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 😄

1reaction
platinumazurecommented, Dec 26, 2016

I could get behind a messaging change that mentions when dangling commas in functions are actually valid. @not-an-aardvark Thoughts?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found