Skip to content

linter: import/namespace inconsistently reports named imports #24073

Description

@aleksanderkatan

What version of Oxlint are you using?

1.72.0

What command did you run?

oxlint

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

import { defineConfig } from 'oxlint';

export default defineConfig({
  plugins: ['import'],
});

What happened?

Repro: link

import { lib } from './module.ts';

console.log(lib['~unstable']); // reported

lib['~unstable'] is reported by import(namespace) (Unable to validate computed reference to imported namespace "lib"). This report is silenced by an additional import line:

import { otherExport } from './module.ts'; console.log(otherExport);
import { lib } from './module.ts';

console.log(lib['~unstable']); // not reported

Unless I misconfigured and misunderstood eslint, nothing should be reported in both cases, as lib is a named import, not a namespace import.

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