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

Use explicit extensions for imports within src #58421

Merged
merged 13 commits into from May 7, 2024

Conversation

jakebailey
Copy link
Member

@jakebailey jakebailey commented May 2, 2024

This is extracted from #58419.

Doing this now would reduce churn, but I'm not 100% certain how we can avoid adding the "wrong" kind of imports in the future before "type": "module"? Lint rule!

@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels May 2, 2024
@jakebailey jakebailey marked this pull request as ready for review May 2, 2024 23:45
@typescript-bot
Copy link
Collaborator

Thanks for the PR! It looks like you've changed the TSServer protocol in some way. Please ensure that any changes here don't break consumers of the current TSServer API. For some extra review, we'll ping @sheetalkamat, @mjbvz, @zkat, and @joj for you. Feel free to loop in other consumers/maintainers if necessary.

@andrewbranch
Copy link
Member

Something weird with the unused baselines check?

@jakebailey
Copy link
Member Author

Weird, will take a look later.

@jakebailey
Copy link
Member Author

@andrewbranch Is there a way to force this to always be required, even though we're currently being treated as CommonJS?

@andrewbranch
Copy link
Member

Not in tsc. You can set "importModuleSpecifierEnding": "js" in VS Code preferences for auto imports, and otherwise use a lint rule to enforce.

@jakebailey
Copy link
Member Author

I'll whip up a lint rule and set that, thanks!

@andrewbranch
Copy link
Member

I know eslint-plugin-import has a rule for that; not sure about others.

@jakebailey
Copy link
Member Author

Sanity checked, and reverting all changes in src, running hereby lint --fix and dprint nets the right result, missing only the manual changes for using export * for the unit test reexport file (no runtime difference, but it makes the imports checked), and then two unit test loading hacks that are in place due to our goofy test runner.

@jakebailey jakebailey merged commit 16beff1 into microsoft:main May 7, 2024
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants