standard / eslint-config-standard

ESLint Config for JavaScript Standard Style

Home Page:https://standardjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enforce JSX quotes

flippidippi opened this issue · comments

What version of this package are you using?
16.0.3

What problem do you want to solve?
Enforce a standard on quotes in JSX.

I feel like this is similar to my other ticket #195, where rules were removed, causing the standard linter to be less useful. As a community, if a standard can't be agreed upon then I think it's ok to sit on that issue until a decision is made, but removing rules because we can't agree feels bad. Having a rule people don't agree with is better than not having the rule at all. I have people who are new to React asking about ident and quotes rules and why they aren't enforced like the rest of the JavaScript. The best I can tell them is, the rule was removed, and we are forced to try to identify issues against these rules in PR reviews, which is the whole point of having a linter in the first place.

What do you think is the correct solution to this problem?
Add back the old rule "jsx-quotes": [2, "prefer-single"],.

Are you willing to submit a pull request to implement this change?
Yep!

I think this sounds good 👍

@LinusU I just realized that this repo exists now eslint-config-standard-jsx. Is this why these were removed? Do we just need to include that for JSX stuff?

Yep seems like it! Hopefully, at least these issues help someone else. Maybe it would benefit to add this as a note to the README? Something like "if you need JSX and/or React specific rules please see eslint-config-standard-jsx and eslint-config-standard-react.