Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

wheasy
Copy link

@wheasy wheasy commented Nov 6, 2018

If the alias module starts with "@", the current "no-extraneous-dependencies" rule will report an error in the case of "@custom/XXX".

@coveralls
Copy link

Coverage Status

Coverage increased (+0.007%) to 97.363% when pulling 9a57101 on wheasy:master into db471a8 on benmosher:master.

3 similar comments
@coveralls
Copy link

Coverage Status

Coverage increased (+0.007%) to 97.363% when pulling 9a57101 on wheasy:master into db471a8 on benmosher:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.007%) to 97.363% when pulling 9a57101 on wheasy:master into db471a8 on benmosher:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.007%) to 97.363% when pulling 9a57101 on wheasy:master into db471a8 on benmosher:master.

@ljharb
Copy link
Member

ljharb commented Nov 6, 2018

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
Copy link
Member

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:

Suggested change
`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)),
Copy link
Member

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.

@ljharb
Copy link
Member

ljharb commented Nov 6, 2018

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?

@wheasy
Copy link
Author

wheasy commented Nov 8, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants