Closed aljones15 closed 5 years ago
First, comma dangle is not allowed in any case in inline arrays or objects. The use case we are discussing is
const x = {
a: 'foo',
b: 'bar',
};
const y = [
'a',
'b',
];
Here's what I said earlier about this:
what happens in linting rules is one thing, but I object to changing any rule related to allowing trailing comma in regular js code. The premise of allowing trailing comma is that it can lead to cleaner diffs, not saving someone from having to type a comma. So, with code that already has a trailing comma in place in an array or an object, means that the diff can be for just one line if a single property or array member is added.
ahhh ok did not know that.
'comma-dangle': ['error', 'only-multiline'],
that is the existing rule
I just want to remove the comma dangle in the eslint configuration template file. I am not proposing any rule changes that restrict other developers.
I have no objection to removing the dangling commas from the templates.
removing them.
@mattcollier @gannan08 can this be closed?
closing this as it has been open for a while.
Current lint rules allow trailing commas
rule is very simple to set: https://eslint.org/docs/rules/comma-dangle