-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
docs(website): blog post on consistent-type-(exports|imports) #6238
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
docs(website): blog post on consistent-type-(exports|imports) #6238
Conversation
Thanks for the PR, @JoshuaKGoldberg! typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community. The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately. Thanks again! 🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint. |
✅ Deploy Preview for typescript-eslint ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, and a great explanation of why this is useful. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This blog post should also probably mention the new verbatimModuleSyntax
compiler option (and why you might not want to use it).
We also might want to wait for this new rule before publishing this:
#6382
Which would help explain to people what they can do about the footgun in verbatimModuleSyntax
.
We also probably want to include mention of other rules that help ensure consistency in your imports:
import/consistent-type-specifier-style
which will enforce consistent use of top-level vs inlinetype
qualifierimport/no-duplicates
which will warn against unnecessary duplicate imports (and with theinline-type-imports
option can work in tandem with the above rule).
In conjunction with consistent-type-imports
, the rules can enforce your imports are always properly qualified and are written in a standard, predictable style (eg always top-level type qualifier or always inline type-qualifier).
packages/website/blog/2022-12-23-consistent-type-exports-and-imports-why-and-how.md
Outdated
Show resolved
Hide resolved
packages/website/blog/2022-12-23-consistent-type-exports-and-imports-why-and-how.md
Outdated
Show resolved
Hide resolved
packages/website/blog/2022-12-23-consistent-type-exports-and-imports-why-and-how.md
Outdated
Show resolved
Hide resolved
packages/website/blog/2022-12-23-consistent-type-exports-and-imports-why-and-how.md
Outdated
Show resolved
Hide resolved
packages/website/blog/2022-12-23-consistent-type-exports-and-imports-why-and-how.md
Outdated
Show resolved
Hide resolved
packages/website/blog/2022-12-23-consistent-type-exports-and-imports-why-and-how.md
Outdated
Show resolved
Hide resolved
packages/website/blog/2022-12-23-consistent-type-exports-and-imports-why-and-how.md
Outdated
Show resolved
Hide resolved
packages/website/blog/2022-12-23-consistent-type-exports-and-imports-why-and-how.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Brad Zacher <brad.zacher@gmail.com>
Co-authored-by: Brad Zacher <brad.zacher@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Frankly, I'd be much more interested in knowing how import type
and import { type }
play with each other and everything else. But I get they are probably not in scope of these rules anyway. We could wait for verbatimModuleSyntax
before writing a follow-up post about all the different type import syntaxes.
packages/website/blog/2023-02-06-consistent-type-exports-and-imports-why-and-how.md
Outdated
Show resolved
Hide resolved
packages/website/blog/2023-02-06-consistent-type-exports-and-imports-why-and-how.md
Outdated
Show resolved
Hide resolved
packages/website/blog/2023-02-06-consistent-type-exports-and-imports-why-and-how.md
Outdated
Show resolved
Hide resolved
packages/website/blog/2023-02-06-consistent-type-exports-and-imports-why-and-how.md
Outdated
Show resolved
Hide resolved
packages/website/blog/2023-02-06-consistent-type-exports-and-imports-why-and-how.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
ICYMI - there were some things I mentioned in my earlier comment WDYT? |
Ah I'd missed that comment, sorry! Re-drafting. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this LGTM - there's lots of good content in there!
PR Checklist
Overview
Adds a blog post and links to it in the rule docs.