question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Work around ESLint plugin discovery issue

See original GitHub issue

There seems to be no visible progress on https://github.com/eslint/eslint/issues/3458, and since it’s disproportionally affecting our users, maybe we should try doing some hack. The biggest issue is that IDEs can’t discover local ESLint and its plugins because they’re inside node_modules/react-scripts/node_modules.

We could try a few things:

  • Ship our own bin script called eslint that launches the “real” eslint with the right NODE_PATH or something (not sure if that would even work)
  • Mess with npm internal state and copy all ESLint folders in node_modules one level higher on npm start. This way it won’t work right after installing but should work after the project is first started. Maybe we could even make that a postinstall script for react-scripts.
  • Something else crazy.

Regardless of the chosen solution, I’d rather do a hack and fix it up later than keep telling people to install global packages.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:21 (20 by maintainers)

github_iconTop GitHub Comments

2reactions
gaearoncommented, Oct 7, 2016

wouldn’t that leave somebody with a hack to deal with once you eject the app?

It should be removed as part of ejecting (we have a way to do that: // @remove-on-eject-begin and // @remove-on-eject-end).

I assume that you are supporting only npm3+ aren’t you?

Nope, we support npm2 because that’s what ships with the stable Node right now.

1reaction
gaearoncommented, Oct 31, 2016

¯_(ツ)_/¯ whatever works

Read more comments on GitHub >

github_iconTop Results From Across the Web

Working with Plugins - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
How to write an ESLint plugin in TypeScript - Darragh ORiordan
I use NestJS at my day job. It's a complicated framework sometimes and there are lots of things that devs “just have to...
Read more >
ESLint fails to load plugins when using ESLint 6.x #696 - GitHub
Failed to load plugin prettier: Cannot find module 'eslint-plugin-prettier' Happened while validating foo.tsx This can happen for a couple of ...
Read more >
Using ESLint to improve your app's performance · allegro.tech
But my curiosity told me to search through our git repository and as a result I discovered multiple usages of Intl.DateTimeFormat without ...
Read more >
How to Prevent Accidental Code Errors with ESLint, Prettier ...
Make Prettier work with ESLint and Husky to protect the code of your project ... Default ESLint config in the package.json file for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found