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: file-extension-in-import cannot fix correctly for barrel file #403

Open
1 task
matzeeable opened this issue Jan 3, 2025 · 0 comments
Open
1 task
Labels

Comments

@matzeeable
Copy link

matzeeable commented Jan 3, 2025

Environment

Node version: 18.20.5
npm version: 10.8.2
ESLint version: 9.17.0
eslint-plugin-n version: 17.15.1
Operating System: Linux 6.1.0-28-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.119-1 (2024-11-22) x86_64 GNU/Linux

What rule do you want to report?

file-extension-in-import

Link to Minimal Reproducible Example

https://eslint-online-playground.netlify.app/#eNqFVM2K2zAQfhVVp2xIbHIohfRS6BZ62pZCT1UPRh5nlZUlI8ltQvC77+jHsp2Q3YCDpPnm/5u5UGe5Vo04FGClUK44Wq3onl6YIoRRODlQtWV0j5eizGCPYnQTQVy3nZBgfnROaBXAQd3LlP7WCuefnOnBvw5JSygu+xq86A+j1nBG/zI10M0U0jKWt9xYZwR3T72UX5+BvwRhdhitoocSTlXbSSicRbOi7bRx5EJ6JyQZSGN0G7Jsz9tGyxoMo5+Zeh9WLnGV0u4ZzO+7cG8oqDDlj6sHPM6U8J7CnVSEquEUw4ZT8LOeLCd7N0r+faHT9Ir72oVUVg9YPuMLhNW2Gqsi9WHF6HeQUn9gFKNC6eD//HdtYhHwPUvnyQ5GlxiWmzv14GjHbL5EUHnEFk5FdTY+jyh37sByIzq3jYI5OL78lP1BqCddw6gU37ddEGyRvqEDKa8amqqXk6cU5cpndbTpZgsDyMIWRwLqQONEwAZ5aQOP1+tyXVyc3bT4cfycPQ3I7IAmJM2Th4Y7IUWBLVr4vPVyDxdZnyEpGP+TlTr01QHSrORJib+uMjbP0ZWMYAmi/V9au0dh9iTWtWjBVUUtjKpayD6TQaOPwF2cuYUMhy8fZ4LYhGvfan/TvJn6eBztjDU1fSh+toRLp/QN2YZiW8xxi/2OSaRtA8ZonO4NYiv5vzoj2TbkMowWgyvvxk8mErer+AsW82ofeRLGxdjqGmPI+7CGf4/Q+fYpLmC5qOb89qqycmAxrOR5ZOkd4cT7dwF5MN7wMpsFj9p9KnYfix2jeWsOr6QwBF8=

image

What did you expect to happen?

  • Resolve import { util } from "./my-folder"; to import { util } from "./my-folder/index.js";
  • Resolve import { util } from "./my-folder/"; to import { util } from "./my-folder/index.js";

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

We are migrating a (very) huge codebase, and we are currently using barrel files and not ESM yet. As first step, we want to force the usage of extensions in the imports and migrate step-by-step.

@matzeeable matzeeable added the bug label Jan 3, 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