Skip to content

v1.37.0 causes regression with import/extensions oxlint rule and .js extensions #17693

Description

@ghiscoding

opening an issue as suggested by @connorshea in this comment: #17539 (comment)

I think this PR causes huge regressions on my end, I have this config:

"import/extensions": [
      "error",
      "ignorePackages",
      {
        "js": "always",
        "mjs": "always",
        "jsx": "never",
        "ts": "never",
        "tsx": "never",
        "json": "always"
      }
    ]

and now running oxlint is failing on all my files that have local .js imports, for example:

  × eslint-plugin-import(extensions): File extension "js" should not be included in the import declaration.
    ╭─[packages/core/src/__tests__/command.spec.ts:10:1]
  9 │
 10 │ import { getChildProcessCount } from '../child-process.js';
    · ───────────────────────────────────────────────────────────
 11 │ import { Command } from '../command.js';
    ╰────
  help: Remove the file extension from this import.

  × eslint-plugin-import(extensions): File extension "js" should not be included in the import declaration.
    ╭─[packages/core/src/__tests__/package.spec.ts:12:1]
 11 │ import type { NpaResolveResult, RawManifest } from '../models/interfaces.js';
 12 │ import { Package } from '../package.js';
    · ────────────────────────────────────────
 13 │
    ╰────
  help: Remove the file extension from this import.

any suggestions? It was working fine with previous version, so I assume this is the PR causing the regression? @connorshea
for reference, here's my oxlint full config file: https://github.com/lerna-lite/lerna-lite/blob/main/.oxlintrc.json, you can clone the project to test it out too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No 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