Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maybe consider disallowing `jsx` extension? #585

Closed
capaj opened this issue Aug 11, 2016 · 2 comments

Comments

@capaj
Copy link
Contributor

commented Aug 11, 2016

I have read beautiful reasoning as to why it is not the best practice to name files with JSX .jsx, but instead .js: airbnb/javascript#985 (comment)

In my future projects I would prefer if I would not see .jsx files- do you think this is a rule standard could merge if I opened a PR for it? I guess there isn't an eslint rule for that, but maybe we could create one? Or maybe just use a simple glob expression?

@feross

This comment has been minimized.

Copy link
Member

commented Aug 11, 2016

Seems like decent reasoning, but I don't feel this is super important. I do know that standard shouldn't automatically fail just because there are .jsx files in the folder you're linting.

We could consider only detecting .js files by default, instead .js and .jsx like we do now. This would slightly discourage usage of .jsx. People who use .jsx would have to change their command to standard *.js *.jsx. If we remove it (even in a major version) some users will still think their .jsx files are being checked when they're not, until they realize it much later. That's not good.

Do other contributors have thoughts?

@feross feross added the question label Aug 11, 2016

@feross

This comment has been minimized.

Copy link
Member

commented Aug 19, 2016

I don't really see the benefit of stopping automatically checking .jsx files. It'll just trip up some users who use that extension. If you don't want to use .jsx, you can just use .js and standard works fine. And as mentioned before, we shouldn't actively prevent the usage of a certain extensions, IMO.

@feross feross closed this Aug 19, 2016

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
2 participants
You can’t perform that action at this time.