Skip to content

docs(code-style): match import organization to eslint config - #9238

Merged
ovflowd merged 1 commit into
nodejs:mainfrom
Devehab:fix/9225-import-order-docs
Oct 31, 2026
Merged

ovflowd merged 1 commit into
nodejs:mainfrom
Devehab:fix/9225-import-order-docs

Conversation

@Devehab

@Devehab Devehab commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Description

The Import Organization section in docs/code-style.md says type-only imports go at the end of each section, but since #8362 the import-x/order rule 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 that pnpm lint:fix sorts 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

  • I dropped the old docs example into a real file under apps/site/components/ and ran ESLint with the site config: 3 import-x/order errors. The new example passes with none.
  • I took the same imports laid out the old way (types at the end of each section) and ran eslint --fix on them. The result comes out in the same order as the new example.
  • pnpm format runs clean with no changes.

Related Issues

Fixes #9225

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run pnpm format to ensure the code follows the style guide.
  • I have run pnpm test to check if all tests are passing.
  • I have run pnpm build to check if the website builds without errors.
  • I've covered new added functionality with unit tests if necessary.

I didn't run pnpm test or pnpm build since this only changes a markdown file in docs/.

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.
@Devehab
Devehab requested review from a team as code owners October 27, 2026 02:33
@vercel

vercel Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
nodejs-org Ready Ready Preview Oct 27, 2026 2:34am UTC

Request Review

@alexicum

Copy link
Copy Markdown
Contributor

@Devehab Commit seemed correct, but here is my experience in using AI
Precision in wording saves our time later.

@codecov

codecov Bot commented Oct 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.14%. Comparing base (85a1407) to head (9a24163).
⚠️ Report is 9 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9238      +/-   ##
==========================================
+ Coverage   86.09%   86.14%   +0.04%     
==========================================
  Files          87       87              
  Lines        6150     6164      +14     
  Branches      369      369              
==========================================
+ Hits         5295     5310      +15     
+ Misses        851      850       -1     
  Partials        4        4              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@github-actions

Copy link
Copy Markdown
Contributor

📦 Build Size Comparison

Summary

Metric Value
Old Total First Load JS 7.20 MB
New Total First Load JS 7.21 MB
Delta 4.05 KB (+0.05%)

Changes

🔄 Modified Routes (4)
Route Old First Load JS New First Load JS Delta
/[locale] 1.69 MB 1.69 MB 📈 1.01 KB (+0.06%)
/[locale]/[...path] 1.69 MB 1.69 MB 📈 1.01 KB (+0.06%)
/[locale]/blog/[...path] 1.69 MB 1.69 MB 📈 1.01 KB (+0.06%)
/[locale]/download/archive/[version] 1.69 MB 1.69 MB 📈 1.01 KB (+0.06%)

@ovflowd
ovflowd added this pull request to the merge queue Oct 31, 2026
Merged via the queue into nodejs:main with commit 3b413c0 Oct 31, 2026
16 checks passed

This branch was successfully deployed

1 active deployment
Preview — 9a24163c Deployed Oct 27, 2026 by vercel[bot]
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.

ESLint import-x/order config doesn't match documented import organization

5 participants