docs(studio): describe the import order the linter actually enforces - #1094
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThis PR updates Studio web import-order guidance. It adds path-specific instructions in ChangesWeb import ordering guidance
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (2)
.coderabbit.yamlweb/AGENTS.md
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]>
c0e1b85 to
8b67fd1
Compare
|
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]>
|
web/AGENTS.mddescribed an import order the linter does not enforce, so reviewers keep filing correct code as a defect.The mismatch
The guideline said:
import/order(web/eslint.config.js:60-74) actually runs as an error with:Two things the guideline misses.
builtinandexternalare collapsed into a single group, and the@nemo/@nvidia/@studiopath aliases resolve as external rather thaninternal— so they land in that same bucket asreactandlucide-reactand sort alphabetically among them. The practical effect is thatreactsorts 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 failspnpm 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.mdnow states the rule's real behaviour, calls out that the alias-before-package ordering is expected, and says to runeslint --fixrather than hand-sorting..coderabbit.yamlgains apath_instructionsentry forweb/**/*.{ts,tsx,js,jsx}telling CodeRabbit that import order is lint-owned and not reviewable.Note for review
The
.coderabbit.yamlhalf changes review behaviour repo-wide, not just for Studio — that's intended, since onlyweb/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