-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[import/extensions] Option to enforce extensions for type-only imports #2530
Comments
Handle what? The ts resolves See also #2111 (comment) |
While I don't disagree (re: overwhelmingly horrific), it looks like this is the world TS users are in for, as some others in #2111 have pointed out. I've gotten some context reading through #2111, but some things are still fuzzy. IIUC, the PR I referenced, while related, is right to ignore type imports because This comment #2111 (comment) seemed to be interesting to folks, though I'm not sure there's agreement there and conversation seems to have gone in a slightly different direction. Is there some consensus around the end of the conversation there but just waiting for someone motivated to take action? @JounQin is the reference to the comment directed to me or @ljharb? I don't think it's particularly interesting to me, but there's a lot I don't know yet about eslint plugins. @ljharb best next step? I'd guess offering my assistance on #2111, mostly asking in case I've misunderstood anything. |
As |
Hey team, do we have an update on this or an alternatives solution? |
We have a use case for enforcing the
.js
extension even on type-only imports (I'm aware this is odd).This requirement stems from supporting TS users using modules (by specifying
"type": "module"
in theirpackage.json
) and specifyingnodenext
formoduleResolution
options in their tsconfig.Some context can be gleaned from this PR, where I created a failing test using ^this configuration and proceeded to resolve the errors by adding
.js
extensions to type-only imports.apollographql/apollo-server#6731
Related: #2270
Does another option seem reasonable to enforce extensions on type-only imports as well? I'd be happy to open a PR to introduce this if so.
The text was updated successfully, but these errors were encountered: