sheaivey / react-axios

Axios Components for React with child function callback
MIT License
180 stars 20 forks source link

Consider switching the eslint comma-dangle rule to always #14

Closed binki closed 7 years ago

binki commented 7 years ago

See the comment at http://eslint.org/docs/rules/comma-dangle

Trailing commas simplify adding and removing items to objects and arrays, since only the lines you are modifying must be touched. Another argument in favor of trailing commas is that it improves the clarity of diffs when an item is added or removed from an object or array

In writing PR #13, I added a line to an array and had to edit two lines instead of 1 because of the eslint rule which is set to never instead of always. Since you’re transpiling anyway, I don’t see the benefit to disallowing dangling commas (they’re only a problem if you leave them in when targeting \<IE8) and there is the disadvantage of greater VCS churn if they are prohibited.

binki commented 7 years ago

https://github.com/sheaivey/react-axios/pull/13/commits/7990c672e9502fe8f3c0006994f9104bde815b09#diff-1fdf421c05c1140f6d71444ea2b27638R14

sheaivey commented 7 years ago

I have added this change to v1.0.3. Thanks for the suggestion.