Skip to content

linter: import/no-duplicates false positives for type and side-effect imports #19632

Description

@oleasteo

What version of Oxlint are you using?

1.50.0

What command did you run?

No response

What does your .oxlintrc.json (or oxlint.config.ts) config file look like?

(edit)

{
  "plugins": ["import"],
  "rules": {
    "import/no-duplicates": ["error", { "preferInline": true }],
  },
}

What happened?

Given

// type-only import
import type { Foo } from "./foo";
// side-effect-only import
import "./foo";

this seems to be flagged by import/no-duplicates

I would expect it to be valid as typescript verbatimModuleSyntax erases the type-only import fully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Fields

    Priority

    None yet

    Effort

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions