IanVS / prettier-plugin-sort-imports

An opinionated but flexible prettier plugin to sort import statements
Apache License 2.0
963 stars 21 forks source link

Fix: Do not combine default type imports with value imports #38

Closed IanVS closed 1 year ago

IanVS commented 1 year ago

This fixes a bug which was causing default type imports to be combined into value imports, which isn't safe to do. For instance,

import { ComponentProps, useEffect } from 'react';
import type React from 'react';

was turning into

import { ComponentProps, useEffect, React } from 'react';

Which is not correct. This change prevents default type imports from ever being merged.

IanVS commented 1 year ago

I'm going to merge this to get the fix released, but I'd still love an ex post facto review if anyone has some time.