-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
[WIP] Refuse to build if user is importing something that isn't declared in package.json #1752
Conversation
That’s the fun part. 👍 |
i believe something along these lines should do the trick class WatchPackageJson {
apply(compiler) {
compiler.plugin("emit", function(compilation, cb) {
compilation.fileDependencies.push(paths.appPackageJson)
cb()
})
}
} |
What we can do is change the file timestamp through
|
FWIW we did not enable this setting in the end (for unrelated reason). Isn't it off by default? |
You're right. The error overlay was stuck for some reason and that's why I thought the results were cached. Sorry for that, I was too quick with my conclusion there. It's already a bit late where I am 😴. I'll see how far I get with the |
Don’t lose sleep over it, we can come back to this later 😉 |
let me try again this time with a loader ;) |
…ransitive or non-existent dependencies are imported
fcf87a9
to
efdb992
Compare
I've added a first version of a plugin which triggers a recheck of files errors when @nfcampos Thank you for the loader implementation. This is also a possible solution. The only downside here ist that |
38410f3
to
a1ca6d2
Compare
… erroneous files when package.json is changed, because it might resolve the issue.
…traneous dependencies
a1ca6d2
to
00e0f58
Compare
How close is this to being finished? Is there more things to do / test? |
@matoilic is this something you're still interested in? thx! |
This is a try to implement #1725. Currently it only enables the
import/no-extraneous-dependencies
ESLint rule. The challenge is now to find a way to forceeslint-loader
to revalidate invalid files when thepackage.json
changes, e.g. when the user fixes a transitive dependency issue by adding the package to his or her ownpackage.json
.