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

[New] max-dependencies: add option ignoreTypeImports #1847

Merged
merged 1 commit into from
Aug 8, 2021

Conversation

rfermann
Copy link
Contributor

@rfermann rfermann commented Jul 6, 2020

Adds support for ignoring type imports.

Fixes #1843. Fixes #1136.

@coveralls
Copy link

coveralls commented Jul 6, 2020

Coverage Status

Coverage decreased (-0.2%) to 97.695% when pulling b11f5ab on rfermann:1843 into 843055c on benmosher:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.005%) to 97.862% when pulling 8195aa3 on rfermann:1843 into 843055c on benmosher:master.

3 similar comments
@coveralls
Copy link

Coverage Status

Coverage increased (+0.005%) to 97.862% when pulling 8195aa3 on rfermann:1843 into 843055c on benmosher:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.005%) to 97.862% when pulling 8195aa3 on rfermann:1843 into 843055c on benmosher:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.005%) to 97.862% when pulling 8195aa3 on rfermann:1843 into 843055c on benmosher:master.

@cherryblossom000
Copy link
Contributor

This will also fix #1136, won't it?

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.

Thanks! You added two test cases with babel-eslint, which covers flow - could we also add some that use TS?

@rfermann
Copy link
Contributor Author

@ljharb I added some tests using the TS parser. But as syntax for type import looks identical for flow and TS, I am not sure if that is what you were asking for.

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.

Thanks, LGTM pending the one comment

src/rules/max-dependencies.js Outdated Show resolved Hide resolved
@cherryblossom000
Copy link
Contributor

Hi, I'm running into this issue a lot and keep having to put // eslint-disable-next-line import/max-dependencies for cases where the type imports make the number of imports exceed the configured max amount. It'll be nice if this PR could get a rebase and be merged.

@ljharb ljharb changed the title [max-dependencies]: add option 'ignoreTypeImports' [New] max-dependencies: add option ignoreTypeImports Aug 8, 2021
@ljharb ljharb force-pushed the 1843 branch 2 times, most recently from b772ad0 to b743a65 Compare August 8, 2021 06:25
@ljharb ljharb merged commit b743a65 into import-js:master Aug 8, 2021
@himynameisdave
Copy link
Contributor

Would be nice to document this option over here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
5 participants