[eslint] Rewired eslint is using wrong version of eslint and plugins
See original GitHub issueThanks for this super-helpful project! I really like how it’s designed and how extensible it is.
I ran into an interesting issue. I’ve found a work-around, but I’m opening this issue to see if this is something you’d like to have fixed here instead.
In my project, I want to use my own eslint configuration, which includes newer versions of some of the plugins that create-react-app uses.
When I run eslint directly, everything works fine. But when CRA runs eslint as part of its webpack pipeline, it runs the version of eslint (and therefore its plugins) that are down in node_modules/react-scripts/node_modules
.
My work-around is to use the undocumented overrides
parameter from #122 to re-resolve the location of eslint
being passed to eslint-loader
relative to my project:
const rewireEslint = require("react-app-rewire-eslint");
const overrideOptions = options => {
options.eslintPath = require.resolve("eslint");
};
module.exports = function override(config, env) {
config = rewireEslint(config, env, overrideOptions);
return config;
}
Is this something that should be done in this package instead? Maybe with some protection to only do the replacement if there is a version of eslint installed locally?
If so, I can try to find some time to work on a PR for it. At the very least, the override
option needs to be documented. I’ll try to work on a PR for that as well.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:6 (4 by maintainers)
@jlaustill the next version of this package is stale at the moment while react-scripts does it’s thing. That is to say don’t try using it yet.
@randycoulman seems this issue is also stale with no feedback from some folks who have been helping maintain that package. Going to close and leave it at the documentation update that was merged.
Merged the PR (for the docs) - will wait it see if anyone else comments. I don’t use this package myself so would rather get thoughts from people who do.