Repository navigation
Conversation
Since nodejs#8362 the import-x/order rule keeps all type-only imports in one group between internal and relative imports, but the docs still said they go at the end of each section. Update the list and the example to match what ESLint actually enforces.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The Import Organization section in
docs/code-style.mdsays type-only imports go at the end of each section, but since #8362 theimport-x/orderrule puts all of them in one group, between internal (#site/*) imports and relative ones. So the example in the docs actually fails lint.I updated the list and the example to match what ESLint enforces, added the
#site/*and CSS groups to the example since they're part of the order too, and mentioned thatpnpm lint:fixsorts imports for you. Two details I checked against real files:#platform/*sorts with the external imports, and only relative CSS imports get pinned after the relative group (CSS imported through#ui/*stays with the internal imports).Validation
apps/site/components/and ran ESLint with the site config: 3import-x/ordererrors. The new example passes with none.eslint --fixon them. The result comes out in the same order as the new example.pnpm formatruns clean with no changes.Related Issues
Fixes #9225
Check List
pnpm formatto ensure the code follows the style guide.pnpm testto check if all tests are passing.pnpm buildto check if the website builds without errors.I didn't run
pnpm testorpnpm buildsince this only changes a markdown file indocs/.