Skip to content

linter: import/namespace reports an existing export as missing #13258

Description

@afgomez

What version of Oxlint are you using?

1.12.0

What command did you run?

oxlint

What does your .oxlintrc.json config file look like?

{
  "$schema": "./node_modules/oxlint/configuration_schema.json",
  "plugins": [
    "import",
  ],
  "categories": {
    "correctness": "error"
  },
  "rules": {
  },
  "settings": {
  },
  "env": {
    "builtin": true
  },
  "globals": {},
  "ignorePatterns": []
}

What happened?

The import/namespace rule incorrectly reports an existing exported type as missing. When running the linter with the following snippet, the linter reports an error on the second use of z.infer.

import * as z from "zod"; // Using version ^3.25.76

const foo = z.object({
  foo: z.string(),
});

// No error reported in this line
export type Foo = z.infer<typeof foo>;

// × eslint-plugin-import(namespace): "infer" not found in imported namespace "zod".
export interface Bar extends z.infer<typeof foo> {
  bar: string;
}

Metadata

Metadata

Assignees

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