From 8b67fd183cb7c8502903347c663b405610acc49c Mon Sep 17 00:00:00 2001 From: mschwab Date: Wed, 5 Aug 2026 08:50:08 -0700 Subject: [PATCH 1/2] docs(studio): describe the import order the linter actually enforces MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .coderabbit.yaml | 10 ++++++++++ web/AGENTS.md | 9 ++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.coderabbit.yaml b/.coderabbit.yaml index dcd6c9a75b..7b04fdf83a 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 + `eslint --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..fe7fb0ac0f 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 `eslint --fix` 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 From 3af855c83bae9dbe6b1ae393fdf7227f565a62f6 Mon Sep 17 00:00:00 2001 From: mschwab Date: Wed, 5 Aug 2026 09:00:58 -0700 Subject: [PATCH 2/2] docs(studio): point at pnpm lint:fix, not eslint directly 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 --- .coderabbit.yaml | 4 ++-- web/AGENTS.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.coderabbit.yaml b/.coderabbit.yaml index 7b04fdf83a..2edeca373e 100644 --- a/.coderabbit.yaml +++ b/.coderabbit.yaml @@ -21,8 +21,8 @@ reviews: - path: "web/**/*.{ts,tsx,js,jsx}" instructions: | Do not comment on import ordering or grouping. It is generated by - `eslint --fix` under an `import/order` rule that runs as an error, and CI - enforces it with `--max-warnings 0`. The `@nemo` / `@nvidia` / `@studio` + `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 diff --git a/web/AGENTS.md b/web/AGENTS.md index fe7fb0ac0f..dc64049144 100644 --- a/web/AGENTS.md +++ b/web/AGENTS.md @@ -90,7 +90,7 @@ If a package defines these scripts, CI will pick them up automatically. No addit - Use named exports over default exports - Use absolute imports via tsconfig path mapping (never relative) -- **Never hand-sort imports — run `eslint --fix` and leave the result alone.** +- **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