-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
feat:add an ignore option for 'no-extraneous-dependencies' #1228
Conversation
3 similar comments
Duplicate of #1227 (please try not to open duplicate PRs) |
@@ -15,10 +15,20 @@ This rule supports the following options: | |||
|
|||
`peerDependencies`: If set to `false`, then the rule will show an error when `peerDependencies` are imported. Defaults to `false`. | |||
|
|||
`ignore`: Some modules can be ignored by the ignore parameter.It supports regular expressions |
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.
I’m pretty opposed to options that are regexes; globs would be sufficient.
Separately:
`ignore`: Some modules can be ignored by the ignore parameter.It supports regular expressions | |
`ignore`: Some modules can be ignored by the `ignore` parameter. It supports regular expressions. |
@@ -185,6 +199,7 @@ module.exports = { | |||
allowDevDeps: testConfig(options.devDependencies, filename) !== false, | |||
allowOptDeps: testConfig(options.optionalDependencies, filename) !== false, | |||
allowPeerDeps: testConfig(options.peerDependencies, filename) !== false, | |||
ignore: (options.ignore || []).map(p => new RegExp(p)), |
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.
This isn’t a safe operation.
This seems like a strange approach to fix the problem of being unable to have an alias that’s a valid package name (with an @). Maybe that should be fixed instead? |
This is really not a good solution. I will close this pr. |
If the alias module starts with "@", the current "no-extraneous-dependencies" rule will report an error in the case of "@custom/XXX".