diff --git a/.coderabbit.yaml b/.coderabbit.yaml index dcd6c9a75b..2edeca373e 100644 --- a/.coderabbit.yaml +++ b/.coderabbit.yaml @@ -17,6 +17,16 @@ reviews: path_filters: - "!sdk/**" path_instructions: + # Studio web sources + - path: "web/**/*.{ts,tsx,js,jsx}" + instructions: | + Do not comment on import ordering or grouping. It is generated by + `pnpm lint:fix` under an `import/order` rule that runs as an error, and + CI enforces it with `--max-warnings 0`. The `@nemo` / `@nvidia` / `@studio` + path aliases resolve as *external*, so they sort alphabetically alongside + `react` and other packages rather than forming a separate "internal" + group. Ordering that looks like "internal before external" is the rule's + output, not a mistake. # Documentation files - path: "documentation/docs/**/*" instructions: | diff --git a/web/AGENTS.md b/web/AGENTS.md index eaa5240f10..dc64049144 100644 --- a/web/AGENTS.md +++ b/web/AGENTS.md @@ -89,8 +89,15 @@ If a package defines these scripts, CI will pick them up automatically. No addit ### Imports and Exports - Use named exports over default exports -- Group imports: external libraries, internal modules, relative imports - Use absolute imports via tsconfig path mapping (never relative) +- **Never hand-sort imports — run `pnpm lint:fix` from `web/` and leave the result alone.** + `import/order` runs as an _error_ (`eslint.config.js`) with + `groups: [['builtin', 'external'], 'internal', ['parent', 'sibling', 'index']]` + and `alphabetize: { order: 'asc' }`. The `@nemo` / `@nvidia` / `@studio` aliases + resolve as **external**, so they share a single alphabetized group with `react`, + `lucide-react` and friends — which sorts `react` near the end. That reads + backwards if you expect "third-party first, ours second", but it is the rule's + output, and reordering fails CI's `--max-warnings 0`. ### React Patterns