create-react-app is quickly gaining adoption. When developing an app created by it, node_modules/.bin/eslint isn't installed, because eslint is not technically in your dependencies.
However, node_modules/eslint/bin/eslint.js is available, and calling node_modules/eslint/bin/eslint.js __FILE__ works as expected.
Creating this stub at node_modules/.bin/eslint works as a workaround:
#!/usr/bin/env sh
exec node_modules/eslint/bin/eslint.js "$@"
Yep, makes sense to me. I can make the linter search upwards in directories for both. I think this is generally the kind of thing I want to support, making configuration automatic where possible.
As always, I'll do this eventually, but anyone can make a pull request for it, if they are up for it.
This should now be implemented.
There's a recently closed issue on CRA about eslint integration :
https://github.com/facebookincubator/create-react-app/issues/808
Current CRA documentation mentions to add eslintConfig to package.json
https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#displaying-lint-output-in-the-editor
If I understand correctly, this won't be necessary any more with ale ? If I'm correct, this would probably diserve a PR on CRA' documentation.
My answer is... I don't know? Facebook makes everything so incredibly complicated. It's like they are really good at being terrible.
The documentation for CRA has changed, and now says instead to add a .eslintrc file that just has:
{
"extends": "react-app"
}
It appears this is still necessary even after the recent ALE changes. Without the .eslintrc file I get a configuration error.
That makes sense. You should create a configuration file, and ALE will tell you do it, if you haven't done so.
Most helpful comment
My answer is... I don't know? Facebook makes everything so incredibly complicated. It's like they are really good at being terrible.