-
Notifications
You must be signed in to change notification settings - Fork 19
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
fix: do not allow importing dev dependencies from src #316
fix: do not allow importing dev dependencies from src #316
Conversation
}, | ||
overrides: [ | ||
{ | ||
files: ['**/test/**', '.eslintrc.js', '.eslintrc.local.js'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah let's start there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My glob is rusty but something like this is what I had in mind to start
"import/no-extraneous-dependencies": ["error", {"devDependencies": ["!lib/**", "!bin/**"]}]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened npm/eslint-config#67
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