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

Mixed type imports does not trigger import/no-duplicates #3035

Open
musjj opened this issue Aug 15, 2024 · 1 comment
Open

Mixed type imports does not trigger import/no-duplicates #3035

musjj opened this issue Aug 15, 2024 · 1 comment

Comments

@musjj
Copy link

musjj commented Aug 15, 2024

This correctly triggers import/no-duplicates:

import { useEffect } from "react";
import { useState } from "react";

But this doesn't:

import { type ComponentProps, useEffect } from "react";
import { useState } from "react";

The rule should merge the imports above into:

import { type ComponentProps, useEffect, useState } from "react";
@ljharb
Copy link
Member

ljharb commented Aug 15, 2024

Note this depends on the configuration, because it could also potentially be autofixed into

import type { ComponentProps } from "react";
import { useState, useEffect } from "react";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants