copy-with-imports icon indicating copy to clipboard operation
copy-with-imports copied to clipboard

Join imports from same package

Open StefanoMartella opened this issue 4 years ago • 1 comments

Hi,

I really appreciate your work 😄 I'd like to know if it is possible to join imports from same package.

example:

https://user-images.githubusercontent.com/29805626/117725385-5a90d380-b1e5-11eb-8d86-ffa51d80c4f3.mp4

in the example I'd like to have:

import React, {useContext} from 'react';

instead of:

import React from 'react';
import {useContext} from 'react';

Thank you!

StefanoMartella avatar May 10 '21 21:05 StefanoMartella

I use prettier with prettier-plugin-organize-imports to format and sort/combine import statements.

Does a solution like that work for your project?

If you'd like to submit a pull request to implement this, I am open to it. The code that brings in the new import statements is here.

stringham avatar May 11 '21 05:05 stringham