Skip to content

Restore case-sensitive import sorting #51617

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

Closed
jakebailey opened this issue Nov 21, 2022 · 2 comments · Fixed by #52090
Closed

Restore case-sensitive import sorting #51617

jakebailey opened this issue Nov 21, 2022 · 2 comments · Fixed by #52090
Assignees
Labels
Infrastructure Issue relates to TypeScript team infrastructure

Comments

@jakebailey
Copy link
Member

In #51579, I switched our sorting to be case insensitive, as sensitive sorting appeared to cause auto-imports to break.

This appears to be caused by #51616 (at least). After that's fixed, we could revert things.

Also, #51615, if we wanted to use organize imports, however that would be a problem regardless, but less of one given auto-imports should be able to put things in the right place. (Though, I'd rather just let a formatter do this for us.)

@jakebailey jakebailey added the Infrastructure Issue relates to TypeScript team infrastructure label Nov 21, 2022
@jakebailey jakebailey self-assigned this Nov 21, 2022
@rubiesonthesky
Copy link

rubiesonthesky commented Nov 21, 2022

In one the PRs (#51565 (review)) weswigham you said:

I do wonder if we'd have a better time switching to import type for type imports, though. Would sure make finding actual cycles easier.

Is there performance change with using type imports, or other difficulties? While talking about taking modules into use, I saw discussion that it's benefical to use that feature by the code base itself so it's easier to see and understand how things work together. I wonder would using type importa have same kind benefit.

Though, I have also seen (maybe in design notes?) that type imports where meant to just help when there was some sort of problem and not recommended to be used if there was no problem with imports.

As Typescript user, I'd like to understand why they are not considered or if they were considered but it was decided to not to do that kind of change right now just to avoid unnecessary changes in code base or some non technical reason. :)

Edit: fixed quoted person

@jakebailey
Copy link
Member Author

Is there performance change with using type imports, or other difficulties?

No, there is no performance change, as type-only imports are removed by tsc, esbuild, etc, no matter how they are declared.

(As to not put words in his mouth, that quote came from me, not Wesley, FYI.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Infrastructure Issue relates to TypeScript team infrastructure
Projects
None yet
2 participants