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(IgnoreImports): allow ignored imports in no-extraneous-dependency #2557

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

kopax-polyconseil
Copy link

Fix : #2400

Idk how to use globs here, so it's no glob, and support ./ for rootDir

Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add tests covering this?

Comment on lines +259 to +260
return config.some(c => (
filename.includes(value.substr(0, 2) === './' ? value.replace('.', process.cwd()) : value)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where does value come from here?

also, let's use slice over substr.

@@ -280,6 +293,7 @@ module.exports = {
const deps = getDependencies(context, options.packageDir) || extractDepFields({});

const depsOptions = {
allowIgnoreImports: testIgnoreImports(options.ignoreImports, filename) !== false,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
allowIgnoreImports: testIgnoreImports(options.ignoreImports, filename) !== false,
ignoreImports: testIgnoreImports(options.ignoreImports, filename) !== false,

@ljharb ljharb marked this pull request as draft January 11, 2023 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

no-unused-modules needs an ignoreImports option
2 participants