-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Add eslint-loader #362
Comments
I really like create-react-app's approach here as they define their own eslintrc that's focused on what will cause bugs not styling problems. We should just copy their approach. I think we can even just depend on their configuration directly. |
@KyleAMathews I think I can pick this up if you just want to shadow the config create-react-app has. Is there anything else you'd want to be considered in this? |
Thinking about it more, we might not want to use their exact lint rules as I think they disallow some things that we wouldn't want to disallow. How about instead of directly depending on their config, you just copy it into our project so we can change things as needed. |
Also consider checking out https://github.com/sindresorhus/xo. It comes with great defaults and the logging is really pretty. There is a loader similar to eslint for webpack as well. |
Xo is just an eslint config at the end ;) |
@MoOx exactly the config can be dropped in as well if not the entire thing. https://github.com/sindresorhus/eslint-config-xo, but aesthetically speaking xo looks nicer. Not sure if that is a concern here :p |
XO is very nice. I haven't mentioned it before (was planning on making a new issue but perhaps we can just do it here) but I really like how Dan added support for showing lint errors in the browser in an overlay — https://twitter.com/dan_abramov/status/780017771447025672 I think we should copy that. It's much better than just showing them in the browser/terminal console. |
create-react-app has it's own dev-server client: https://github.com/facebookincubator/create-react-app/blob/00c920806719de8f527b13c03bd17f2a2bc60d34/packages/react-dev-utils/webpackHotDevClient.js This is a drop in replacement so it should work for gatsby |
There are other cool overlays out there: https://github.com/jesstelford/react-bsod and https://github.com/commissure/redbox-react |
If there's a consensus on using XO, I'd be happy to take that up |
My main thing is putting the warnings on the overlay. Beyond that I haven't
|
Hello fellas, any news on this? I'm also looking forward to Thanks for you great work |
@lfilho this issue won't solve that — if you're running your own eslint configuration then you'll need to adjust it to match Gatsby e.g. disabling the check that all dependencies are listed in your package.json. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
this is added in #4893 🎉 (eslint config is based on |
We ship starters with eslint configs but they're basically useless unless a user has their editor setup to support Eslint. Add eslint-loader would change that as errors would then show up in the console/browser. If we do this however, the eslint config in starters should probably be a lot less opinionated though so we're not pointlessly pushing the arbitrary eslint choices I've made here.
https://github.com/MoOx/eslint-loader
The text was updated successfully, but these errors were encountered: