tillarnold/grunt-jsxhint

Use locally installed react-tools

Closed this issue · 4 comments

Depending on a specific version of react-tools, while the user might be using a different one can lead to problems. I've run into similar issues for every precompiler out there.

The best solution is to do a try/catch for requiring react-tools and throw an error if it is not installed, hopefully with a helpful error message on how to fix the problem

The best solution is to do a try/catch for requiring react-tools and throw an error if it is not installed, hopefully with a helpful error message on how to fix the problem

This is a good solution. I'll do that.

I initially wanted to add react-tools (without a version number) as a peerDependencie. But then it would not work when react-tools is installed globally, or would it?

Peerdecpendencies are are real pain to work with. We've been wrapping compilers like this in assetgraph for years, and when we used peer dependencies there was always something broken either in a dev setup with linked dependencies, with globally available modules or even worse, in production.

Just move react-tools down to a dev-dependency so you can still run all tests on this repository when developing

Ok I'll do that.

https://www.npmjs.org/package/accord might be an interesting project for this. Allthough there is no jsx support yet. I think we need it for assetgraph pretty soon, so I'll probably send a pull request to add it to accord.

I'll see if I can remember to trickle it back here as well when it's done