Skip to content

linter: import/extensions erroneously throws on bare specifiers #17501

Description

@JakobJingleheimer

What version of Oxlint are you using?

1.35.0

What command did you run?

oxlint --type-aware

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

{
  //
  "plugins": ["import"],
  "rules": {
    "import/extensions": ["error", "always"],
    //
  },
}

What happened?

Lines like these erroneously trigger "Missing file extension in import declaration":

import crypto from 'node:crypto';
import { useState } from 'react';

It appears the rule now throws for any import specifier without a file extension (I'm guessing it will also trigger for subpath imports aka import aliases).

I tried to reproduce in the playground, but I can't repro any lint errors requiring custom config (despite editing the json).

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