forked from mysticatea/eslint-plugin-node
-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
[file-extension-in-import] Does not work properly in TypeScript projects with allowImportingTsExtensions #134
Labels
Comments
🤔 This makes sense, I will try to look next week. Thanks for the report! |
This was referenced Nov 7, 2023
scagood
added a commit
to scagood/eslint-plugin-n
that referenced
this issue
Nov 26, 2023
scagood
added a commit
to scagood/eslint-plugin-n
that referenced
this issue
Dec 11, 2023
@scagood I see that you've fixed the bug on your fork, good work! Anything I can do to move this issue along? |
There are two things holding this back:
I should get some time on Thursday to look into the broken rule problem. |
scagood
added a commit
to scagood/eslint-plugin-n
that referenced
this issue
Jan 2, 2024
aladdin-add
pushed a commit
that referenced
this issue
Jan 9, 2024
scagood
added a commit
to scagood/eslint-plugin-n
that referenced
this issue
Jan 9, 2024
aladdin-add
added a commit
that referenced
this issue
Jan 9, 2024
* feat: Use enhanced-resolve for imports * chore: Improve the metadata from "ImportTarget" * chore: remove "enhanced-resolve" from "no-hide-core-modules" * test: Add a test for #66 * feat!: Allow ts paths aliases (#84) * feat: Allow for "allowImportingTsExtensions" (#134) * feat: Add test for import maps (#147) * Update lib/util/import-target.js Co-authored-by: Sebastian Good <2230835+scagood@users.noreply.github.com> * test: Add test for n/no-missing-require eslint/use-at-your-own-risk * chore: Remove esbuild * feat: Allow for settings.cwd to be used before process.cwd * chore: replace reference to eslint/use-at-your-own-risk * chore: Remove more unused packages * chore: update rule test options to flat config * fix: incorrect env in tests --------- Co-authored-by: 唯然 <weiran.zsd@outlook.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment
Hello,
With the following config:
Will autofix this:
To this:
However, this is a bug in TypeScript projects that use
allowImportingTsExtensions
. In such projects, having a ".js" import is a bug, because the assumption is that our entire application is written in TypeScript, and no JavaScript files will probably ever exist.Proposal:
Instead of fixing to
.js
, the rule should auto-fix to.ts
when the "tsconfig.json" has theallowImportingTsExtensions
option set to true.What rule do you want to report?
file-extension-in-import
Participation
The text was updated successfully, but these errors were encountered: