-
Notifications
You must be signed in to change notification settings - Fork 234
chore: allow type only imports for 'mongodb' package in connection-form #5207
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
Conversation
After checking the docs again, I figured that this won't work with inline type imports. Now I could try writing a custom rule but I think we should probably get consistent with how we import types. What do you guys think? |
Can you clarify a bit what do you mean by inline type imports and where this would cause an issue? |
By inline I meant this:
We were earlier using the following syntax:
but lately I saw a lot of usage of the inline type imports which sounds ok (maybe better in the way that they at-least allow import declaration of the package only once) but unfortunately that syntax fails for all the rules (no-restricted-syntax, no-extraneous-dependencies, no-restricted-imports) that I tried while attempting this restriction. |
Gotcha, thanks for context. IIRC this is mostly coming from eslint autofix and eslint autofixes to |
Yea that sounds about right, the plugin would eventually get updated. Alright I will keep it as is. Thank you :) |
{ | ||
paths: [ | ||
{ | ||
name: 'mongodb', |
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 think connection storage was another one that we only want as type-only dep here, right?
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.
Thank you, I overlooked this one - added this in 247e5ca
Co-authored-by: Sergey Petushkov <petushkov.sergey@gmail.com>
Description
This is a follow up for the PR-5197 where we moved 'mongodb' to devDependencies in connection-form. In this PR we are restricting imports from 'mongodb' package to type only to avoid any possible regression in future.
Checklist
Motivation and Context
Open Questions
Dependents
Types of changes