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

fixMissingImports() not importing missing ObjectId from bson #1511

Open
mownikaasokan opened this issue Mar 7, 2024 · 0 comments
Open

fixMissingImports() not importing missing ObjectId from bson #1511

mownikaasokan opened this issue Mar 7, 2024 · 0 comments

Comments

@mownikaasokan
Copy link

mownikaasokan commented Mar 7, 2024

Describe the bug
Using ts-morph in fixing missing imports when converting flow file to Typescript file. It doesn't fix missing import for ObjectId. (which is from bson package)

Version: 13.0.2

To Reproduce

Input TS file. Both the types are used in the file.

// @flow
/* flow-include
 import type { LineItemLayout } from './types/line-item-layout'
 import type { ObjectId } from 'bson'
*/
...

Actual behavior
Only one import is added.

// @flow
/* flow-include
 import type { LineItemLayout } from './types/line-item-layout'
 import type { ObjectId } from 'bson'
*/

import { LineItemLayout } from './types/line-item-layout'
...

Expected behavior
Both the imports are added.

// @flow
/* flow-include
 import type { LineItemLayout } from './types/line-item-layout'
 import type { ObjectId } from 'bson'
*/

import { LineItemLayout } from './types/line-item-layout'
import { ObjectId } from 'bson'
...
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

No branches or pull requests

1 participant