Skip to content

docs(studio): describe the import order the linter actually enforces - #1094

Merged
marcusds merged 2 commits into
mainfrom
fix-web-import-order-guideline/mschwab
Aug 5, 2026
Merged

docs(studio): describe the import order the linter actually enforces#1094
marcusds merged 2 commits into
mainfrom
fix-web-import-order-guideline/mschwab

Conversation

@marcusds

@marcusds marcusds commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

web/AGENTS.md described an import order the linter does not enforce, so reviewers keep filing correct code as a defect.

The mismatch

The guideline said:

Group imports: external libraries, internal modules, relative imports

import/order (web/eslint.config.js:60-74) actually runs as an error with:

groups: [['builtin', 'external'], 'internal', ['parent', 'sibling', 'index']],
alphabetize: { order: 'asc', caseInsensitive: true },

Two things the guideline misses. builtin and external are collapsed into a single group, and the @nemo / @nvidia / @studio path aliases resolve as external rather than internal — so they land in that same bucket as react and lucide-react and sort alphabetically among them. The practical effect is that react sorts near the end of the block, and an alias can legitimately precede a third-party package.

Read against the old guideline, correct output looks wrong.

Why it matters

CodeRabbit flagged exactly this on #1005, citing _Source: Coding guidelines_ — it was faithfully applying our doc. Its suggested reordering fails pnpm lint (--max-warnings 0, web/package.json:13), so acting on it would have broken CI. Humans and coding agents read the same file and reach the same wrong conclusion.

What changes

web/AGENTS.md now states the rule's real behaviour, calls out that the alias-before-package ordering is expected, and says to run eslint --fix rather than hand-sorting.

.coderabbit.yaml gains a path_instructions entry for web/**/*.{ts,tsx,js,jsx} telling CodeRabbit that import order is lint-owned and not reviewable.

Note for review

The .coderabbit.yaml half changes review behaviour repo-wide, not just for Studio — that's intended, since only web/ has these aliases, but it's worth agreeing to deliberately.

No source files are touched and no import statements are reordered; this only corrects the documentation of an existing, unchanged rule.

Summary by CodeRabbit

  • Documentation
    • Updated development guidance to clarify import ordering, grouping, alias handling, and automated enforcement.
    • Added path-specific review instructions for Studio web source files.

@marcusds
marcusds requested review from a team as code owners August 5, 2026 15:54
@github-actions github-actions Bot added the docs label Aug 5, 2026
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 584a1ce1-d36b-4e67-8799-322687c71b10

📥 Commits

Reviewing files that changed from the base of the PR and between 8b67fd1 and 3af855c.

📒 Files selected for processing (2)
  • .coderabbit.yaml
  • web/AGENTS.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • .coderabbit.yaml
  • web/AGENTS.md

📝 Walkthrough

Walkthrough

This PR updates Studio web import-order guidance. It adds path-specific instructions in .coderabbit.yaml and revises web/AGENTS.md to document ESLint-managed ordering, alias handling, and CI enforcement.

Changes

Web import ordering guidance

Layer / File(s) Summary
Import ordering guidance
.coderabbit.yaml, web/AGENTS.md
Adds Studio web path instructions for ESLint-enforced import ordering. Updates agent guidance to require pnpm lint:fix, preserve configured grouping and alphabetization, treat aliases as external imports, and avoid reorderings that fail CI.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the documentation change for the import order enforced by the linter.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-web-import-order-guideline/mschwab

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@web/AGENTS.md`:
- Around line 93-94: Update the import-order guidance in web/AGENTS.md to
instruct contributors to run pnpm lint:fix from the web/ directory instead of
eslint --fix, preserving the repository’s configured ESLint version and lint
flags.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 538cf32f-6aee-43ab-83d1-4b8864468ec0

📥 Commits

Reviewing files that changed from the base of the PR and between 603b97b and c0e1b85.

📒 Files selected for processing (2)
  • .coderabbit.yaml
  • web/AGENTS.md

Comment thread web/AGENTS.md Outdated
The guideline said "group imports: external libraries, internal modules,
relative imports", which is not what `import/order` does. It collapses
builtin and external into one group and alphabetizes within it, and the
`@nemo` / `@nvidia` / `@studio` aliases resolve as external — so they sort
alongside `react` instead of forming an internal group.

Reviewers read the guideline, see an alias ahead of a package, and file it
as a defect. CodeRabbit did exactly that on #1005, citing "Coding
guidelines" as its source. Its suggested reordering fails `--max-warnings 0`.

State the rule's real behaviour, and tell CodeRabbit that import order is
lint-owned and not reviewable.

Signed-off-by: mschwab <[email protected]>
@marcusds
marcusds force-pushed the fix-web-import-order-guideline/mschwab branch from c0e1b85 to 8b67fd1 Compare August 5, 2026 15:58
@marcusds marcusds changed the title docs(web): describe the import order the linter actually enforces docs(studio): describe the import order the linter actually enforces Aug 5, 2026
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

The repo script carries --report-unused-disable-directives and --max-warnings 0 and uses the pinned ESLint; AGENTS.md already says to go through package scripts rather than invoking tools directly.

Signed-off-by: mschwab <[email protected]>
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor
Suite Lines Covered Line Rate Branch Rate
Unit Tests 30743/39237 78.3% 62.7%
Integration Tests 18062/37189 48.6% 21.0%

@marcusds
marcusds added this pull request to the merge queue Aug 5, 2026
Merged via the queue into main with commit 6dd08d4 Aug 5, 2026
52 checks passed
@marcusds
marcusds deleted the fix-web-import-order-guideline/mschwab branch August 5, 2026 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants