fix: do not allow importing dev dependencies from src#316
fix: do not allow importing dev dependencies from src#316tjenkinson wants to merge 1 commit intonpm:mainfrom
Conversation
| }, | ||
| overrides: [ | ||
| { | ||
| files: ['**/test/**', '.eslintrc.js', '.eslintrc.local.js'], |
There was a problem hiding this comment.
making an assumption this covers everything that's not considered package src. Not sure if that's actually the case?
There was a problem hiding this comment.
The standard that templateOSS sets up is
"files": [
"bin/",
"lib/"
],It's much easier to explicitly specify where the code is than where it isn't. The rule should apply to those two directories and the handful of projects that need to override this can do so.
There was a problem hiding this comment.
Ah that’s good to know. Shall I open a pr on the config repo then for these folders?
There was a problem hiding this comment.
My glob is rusty but something like this is what I had in mind to start
"import/no-extraneous-dependencies": ["error", {"devDependencies": ["!lib/**", "!bin/**"]}]
|
The tracking issue is here but this may have to end up in our eslint config package. It may also warrant a discussion about what the rule looks like. Almost all of our repos have their code isolated to |
## References Refs npm/template-oss#316 Needed by npm/node-semver#559
See npm/node-semver#559 (comment)
Not sure if this needs to be opt-in, or if it can apply to all projects using this?
References
Needed by npm/node-semver#559