standard / eslint-config-standard-react

ESLint Shareable Config for React/JSX support in JavaScript Standard Style
https://standardjs.com
MIT License
456 stars 87 forks source link

The Curious Case of the Dangling Comma #7

Closed GantMan closed 8 years ago

GantMan commented 9 years ago

I'm interested in using your library, and though I know it's not up for debate, I do seek a footnote on your reasoning to keep the comma-dangle rule in standard-react.

I know IE 8 is the culprit and I'm not even going to debate the scarcity of such a terrible browser.

What I'm interested in, is would you consider at the very least, creating a version of standard-react that is primarily for react-native. A safe place, where IE 8 can never go, and the friendliness of ECMA Script 5's dangling comma can come out and join the land of good ideas.

Poetic/Comma Deprived license aside, I'm interested in your feedback and thoughts on making Standard available for best practices in React Native.

feross commented 8 years ago

Hey @GantMan, thanks for your thoughtful issue!

The reason that we keep the comma-dangle rule, even in this config which appears to be specific to react, is that this config is actually used in the main standard tool. We ship one tool and need to decide on one set of rules. If you're doing a React Native project and want to change this rule you can look into extending standard using eslint shareable configs.

Even when IE8 marketshare dwindles, we probably won't change this rule because so many people depend on standard and it's not fair to make them change their code because our preferences may have changed.

dcousens commented 8 years ago

@feross it could be worthwhile when we make the breaking change of assuming everyone is on ES6.

feross commented 8 years ago

Perhaps. But the formatter needs to be able to automatically fix people's code if we make a rule change. And right now the formatter is pretty bad at handling ES6.

dcousens commented 8 years ago

Indeed, but I suspect this is all a ways off.

feross commented 8 years ago

Yep, agreed.

On Mon, Nov 16, 2015 at 4:50 PM Daniel Cousens notifications@github.com wrote:

Indeed, but I suspect this is all a ways off.

— Reply to this email directly or view it on GitHub https://github.com/feross/eslint-config-standard-react/issues/7#issuecomment-157223430 .

GantMan commented 8 years ago

Thanks for insight! I'll make peace with the dangle-comma (for now :+1: ) heh.

Cheers!