Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

"Lint JSX Files" doesn't seem to work #331

Closed
macgyver opened this issue Sep 7, 2016 · 5 comments
Closed

"Lint JSX Files" doesn't seem to work #331

macgyver opened this issue Sep 7, 2016 · 5 comments

Comments

@macgyver
Copy link

macgyver commented Sep 7, 2016

The "Lint JSX Files" option doesn't seem to work at all - any jsx at all results in a E015 - Unclosed regular expression

Also, it's not clear how it's meant to work - is it just based on file extension?

@Arcanemagus
Copy link
Member

That option simply toggles running on files identified by the source.js.jsx scope, the most common method of identifying as that scope being the file extension (you can always change the language in the lower right corner though).

It used to change a flag passed to JSHint, but at some point they brought support for that into the main linter process by default, so it doesn't change the behavior of the linter at all.

Do you see the same results when running JSHint from the CLI?

@macgyver
Copy link
Author

macgyver commented Sep 8, 2016

Yes, good point - although I don't see any reference on jshint.com of supporting JSX.. there is a link at the bottom of the Install page (under Other cool stuff) to https://github.com/CondeNast/JSXHint (which in turn links to https://github.com/STRML/JSXHint/) which makes me think that jshint doesn't actually claim to work for JSX?

@Arcanemagus
Copy link
Member

It's quite possible. I know it is very buggy with it. You should probably look into using ESLint with the JSX options enabled, see https://www.npmjs.com/package/eslint-plugin-react for an example of how to set that up.

@macgyver
Copy link
Author

macgyver commented Sep 8, 2016

Thanks :) I've actually already switched to that on projects using JSX, but even after removing the .jshintrc file from those projects I'm still seeing the errors (due to #291) so I figured I'd report it..

Don't you think you should remove this option from the atom package settings since it definitely doesn't work and probably never will?

@Arcanemagus
Copy link
Member

Generally I'd leave that up to the package maintainer... but it seems this package has no active maintainer so I'd go for that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants