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

Linting normal .js files is really slow #4

Closed
Munter opened this issue Jul 15, 2014 · 6 comments
Closed

Linting normal .js files is really slow #4

Munter opened this issue Jul 15, 2014 · 6 comments

Comments

@Munter
Copy link
Contributor

Munter commented Jul 15, 2014

I'm guessing everything is run through the transformer as it is.
I have thousands of files that aren't jsx yet. Plugging in grunt-jsxhint as a drop in replacement considerably slows down my linting.

Any way to be able to tell the linter which files should be transformed and which should pass through untouched?

@tillarnold
Copy link
Owner

As of now there is no way to do this.
I could add some code that would check if the file starts with

/**
 * @jsx React.DOM
 */

and only run the file trought the transformer if this is the case.
Would that be a possible solution?

Or it could check if the file has a .jsx file extension.

@Munter
Copy link
Contributor Author

Munter commented Jul 15, 2014

We're not fans of adding that comment at the top, as our internal naming convention of keeping the .jsx extension is enough for us to determine if it needs transforming.

If there was a split code path based on the file extension that would fit our use case perfectly. I haven't been working with jsx long enough to know any other use cases yet.

@tillarnold
Copy link
Owner

ok. I will add the split code path based on the file extension.

@Munter
Copy link
Contributor Author

Munter commented Jul 15, 2014

Awesome!

@tillarnold
Copy link
Owner

I added the check for the file extension. Now only .jsx files run through the transformer. I published the package to npm.

@Munter
Copy link
Contributor Author

Munter commented Jul 15, 2014

Thanks. I'll update when I get back at work in the morning :)

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

No branches or pull requests

2 participants