From 55855035f92245112ace775e15d858ceb6730c1e Mon Sep 17 00:00:00 2001 From: neverland Date: Wed, 2 Sep 2026 11:37:51 +0800 Subject: [PATCH] docs: prefer rs check in migration skill --- .agents/skills/migrate-to-rstack-cli/SKILL.md | 13 +++++++++++++ .../migrate-to-rstack-cli/references/rslint.md | 9 ++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.agents/skills/migrate-to-rstack-cli/SKILL.md b/.agents/skills/migrate-to-rstack-cli/SKILL.md index 3cce92b..b2bc7dc 100644 --- a/.agents/skills/migrate-to-rstack-cli/SKILL.md +++ b/.agents/skills/migrate-to-rstack-cli/SKILL.md @@ -34,6 +34,19 @@ Read every matching reference before editing. Load only the tools present in the Rsbuild, Rslib, Rstest, Rslint, and Prettier remain transitive `rstack` dependencies. Remove obsolete direct dependencies and imports from the migrated scope; do not expect their names to disappear from the lockfile. +### Combined checks + +After migrating lint and formatting commands, prefer the shorter combined command when behavior is equivalent: + +| Separate commands | Preferred command | +| ---------------------------------------- | ----------------------- | +| `rs lint && rs fmt --check` | `rs check` | +| `rs lint --type-check && rs fmt --check` | `rs check --type-check` | + +`rs check` preserves the order and short-circuit behavior of these `&&` chains. + +Combine only when both commands use the same working directory and Rstack config, with no positional inputs or command-specific options beyond those shown. Move a shared `-c` or `--config` to `rs check`. Keep the commands separate when their environment, wrappers, scope, execution order, concurrency, or output handling differs. + ## Configuration ### Config files diff --git a/.agents/skills/migrate-to-rstack-cli/references/rslint.md b/.agents/skills/migrate-to-rstack-cli/references/rslint.md index f51c37d..8910d91 100644 --- a/.agents/skills/migrate-to-rstack-cli/references/rslint.md +++ b/.agents/skills/migrate-to-rstack-cli/references/rslint.md @@ -39,17 +39,20 @@ define.lint(({ globals }) => [ ## Script pattern -If a script also runs Prettier, migrate its formatting command as described in [prettier.md](prettier.md). +For example: ```json { "scripts": { - "lint": "rs lint && rs fmt --check", - "lint:write": "rs lint --fix && rs fmt" + "check": "rs check", + "format": "rs fmt", + "lint": "rs lint" } } ``` +Preserve existing script names unless renaming is requested. For scripts that also run Prettier, follow [prettier.md](prettier.md), then apply the [combined-check rules](../SKILL.md#combined-checks). + ## Validate Run lint without writes. If Rstack upgrades Rslint, preserve the pre-migration lint baseline: disable newly enabled rules instead of changing source code, unless code changes are requested.