Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions .agents/skills/migrate-to-rstack-cli/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,21 @@ define.test({
});
```

Prefer async config functions and dynamic imports for runtime plugins and presets:
Use dynamic imports in async config functions only for external plugins, presets, and other dependencies:

```ts
define.lint(async () => {
const { js, ts } = await import('rstack/lint');
return [js.configs.recommended, ts.configs.recommended];
define.app(async () => {
const { pluginReact } = await import('@rsbuild/plugin-react');
return {
plugins: [pluginReact()],
};
});
```

`define.lint` provides `@rslint/core` APIs to its config factory, so no manual import is needed:

```ts
define.lint(({ js }) => [js.configs.recommended]);
```

Rstack loads TypeScript configs as native ESM. Preserve runtime-resolvable file extensions, replace CommonJS globals such as `__dirname`.
14 changes: 6 additions & 8 deletions .agents/skills/migrate-to-rstack-cli/references/rslint.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,20 @@ Read this reference when the project uses `@rslint/core`, `rslint.config.*`, `rs
## Steps

1. Replace the `rslint` executable prefix with `rs lint`. For example, replace `rslint --fix` with `rs lint --fix`.
2. Move the old config into `define.lint`, replacing Rslint's `defineConfig()` wrapper and import. Dynamically import presets from `rstack/lint` inside an async config function.
3. Replace direct config/API imports from `@rslint/core` with exports from `rstack/lint` where available.
4. Replace custom `--config` paths with the migrated `rstack.config.*` path.
5. Remove `@rslint/core` only when no uncovered direct runtime API remains. Delete `rslint.config.*`.
2. Move the old config into `define.lint`, replacing Rslint's `defineConfig()` wrapper and import. Receive `@rslint/core` exports from the factory parameter.
Comment thread
chenjiahan marked this conversation as resolved.
3. Replace custom `--config` paths with the migrated `rstack.config.*` path.
4. Remove `@rslint/core` only when no uncovered direct runtime API remains. Delete `rslint.config.*`.

## Config Pattern

```ts
import { define } from 'rstack';

define.lint(async () => {
const { js, ts } = await import('rstack/lint');
return [js.configs.recommended, ts.configs.recommended];
});
define.lint(({ js, ts }) => [js.configs.recommended, ts.configs.recommendedTypeChecked]);
```

Preserve existing presets and rules during migration.

## Script Pattern

If a script also runs Prettier, migrate its formatting command as described in [prettier.md](prettier.md).
Expand Down