import-js/eslint-plugin-import

Mixed `type` imports does not trigger `import/no-duplicates`

Open

Aperta il 15 ago 2024

Vedi su GitHub
 (1 commento) (0 reazioni) (0 assegnatari)JavaScript (4946 star) (1540 fork)batch import
bughelp wantedtypescript

Descrizione

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";

Guida contributor