Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Regression between 17.15.1 and 17.16.1 with file-extension-in-import #413

Open
1 task
Zamiell opened this issue Mar 2, 2025 · 0 comments
Open
1 task
Labels

Comments

@Zamiell
Copy link

Zamiell commented Mar 2, 2025

What rule do you want to report?

file-extension-in-import

Description

There is a regression in the latest version such that I have code like this:

import { $ } from "complete-node";

Now triggers the rule:

require file extension '.js'  n/file-extension-in-import

Which is a false positive, because this is a package import from a dependency, it's not referring to a file. However in this case I am using tsconfig paths like this:

{
  "compilerOptions": {
    "paths": {
      "complete-node": ["./packages/complete-node/src/index.ts"],
    },
  },
}

So I think it is getting confused because "index.ts" is a file. Anyways, it must be related to something in the last update.

Steps to Reproduce

git clone [email protected]:complete-ts/complete.git
cd complete
git switch n-bug
npm ci
cd packages/complete-cli
npx eslint src/constants.ts

What did you expect to happen?

To have no ESLint warning/error occur.

Environment

Node version: v22.14.0
npm version: 10.9.2
ESLint version: 9.21.0
eslint-plugin-n version: 17.16.1
Operating System: Windows

Participation

  • I am willing to submit a pull request for this issue.
@Zamiell Zamiell added the bug label Mar 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant