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

ESLINT-32 add import/no-exteneous-dependencies #31

Merged
merged 2 commits into from
Apr 24, 2020
Merged

Conversation

samelliottdlt
Copy link
Contributor

We had a little discussion about this rule during band meeting and I've talked to @gatsbyz on the side about getting this rule up and running.

The configuration that we have here will result in all imports of packages that are not defined in the package.json will result in an error. I know there are a few services that use aws-sdk without having it as a dependency in their package.json.

Dev dependencies can only be used within .spec and .test files.

This repo doesn't have labels. I'll publish it manually after it has been merged.

@carlansley
Copy link
Contributor

one wrinkle I thought of, do you know if this works with the new typescript import type syntax? it would be ok for prod code to import devDependencies in this case, i've used it a bit already. (.e.g. import type { v2 as account } from '@checkdigit/account';, where account is a devDependency)

@samelliottdlt
Copy link
Contributor Author

@carlansley looks like the answer is no. Check out this issue: import-js/eslint-plugin-import#1618

The latest comment comments on how it fails with import/types. Looks like the solution would be to losen the dev dependency but I think that makes @gatsbyz's rollup issue possible again.

Copy link
Contributor

@gatsbyz gatsbyz left a comment

Choose a reason for hiding this comment

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

lgtm

@carlansley
Copy link
Contributor

@samelliottdlt think we can ignore this issue for now, I'm sure they'll fix it in the fullness of time. And I doubt import type is used in very many places.

@carlansley carlansley merged commit 7ce36c4 into master Apr 24, 2020
@carlansley carlansley deleted the ESLINT-32 branch April 24, 2020 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants