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

Sort requires #290

Merged
merged 3 commits into from
Oct 31, 2024
Merged

Sort requires #290

merged 3 commits into from
Oct 31, 2024

Conversation

lishaduck
Copy link
Contributor

Extracted from #253.

No, there's not an eslint rule to enforce this, sadly. I spent a few hours some night in late August when I was procrastinating and didn't want to get my homework done 😉

- Sort `require`s.
- Move type imports above real imports.
- Switch to `@import` for imports needing `resolution-mode`.
- Enable `noUnusedLocals`.
- Move exports to the bottom of files.
- Switch an inline type import to an import declaration.
- Use `... = require('...').default` over `{default: ...} = require('...')`.
- Refactored `spinner.js` exports to be typesafe.
- Fix a type error in `extra-files.js`. Less dependency injection 🙁
@lishaduck
Copy link
Contributor Author

@jfmengels, pinging b/c this is conflict prone, so the rest of my PRs are blocked on this.

@jfmengels jfmengels merged commit 80e222d into jfmengels:main Oct 31, 2024
3 checks passed
@jfmengels
Copy link
Owner

There are a few good things mixed in with this (and I don't want to block your other work that may depend on this), so I've merged it, but this is also not super necessary either. In the sense that if you would have asked me whether we should do something about import sorting, I would likely have told you no. Plus, it was kind of sorted to my own heuristic, now it's sorted to a heuristic I don't know. No worries, but I think there are more interesting things to be worked on in the future 🤷‍♂️

@lishaduck
Copy link
Contributor Author

super necessary either. In the sense that if you would have asked me whether we should do something about import sorting, I would likely have told you no.

Fair enough.

Plus, it was kind of sorted to my own heuristic, now it's sorted to a heuristic I don't know.

It looked alphabetical to me, so I thought I'd messed it up.

No worries, but I think there are more interesting things to be worked on in the future 🤷‍♂️

Agreed.

@lishaduck lishaduck deleted the sort-imports branch November 4, 2024 02:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants