Skip to content

Commit 1b5185b

Browse files
authored
docs(skills): clarify Rslint migration config (#390)
1 parent c525d43 commit 1b5185b

2 files changed

Lines changed: 24 additions & 4 deletions

File tree

‎.agents/skills/migrate-to-rstack-cli/SKILL.md‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ Read every matching reference before editing. Load only the tools present in the
3434

3535
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.
3636

37-
## Configuration Rules
37+
## Configuration
38+
39+
### Config Files
40+
41+
Treat each workspace or config root independently. A monorepo may need multiple Rstack config files when commands run from different package directories; validate config discovery from each directory.
3842

3943
Use one of the default names: `rstack.config.ts`, `.js`, `.mts`, or `.mjs`.
4044

@@ -53,6 +57,8 @@ define.test({
5357
});
5458
```
5559

60+
### Modules and Imports
61+
5662
Use dynamic imports in async config functions only for external plugins, presets, and other dependencies:
5763

5864
```ts

‎.agents/skills/migrate-to-rstack-cli/references/rslint.md‎

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ Read this reference when the project uses `@rslint/core`, `rslint.config.*`, `rs
66

77
1. Replace the `rslint` executable prefix with `rs lint`. For example, replace `rslint --fix` with `rs lint --fix`.
88
2. Move the old config into `define.lint`, replacing Rslint's `defineConfig()` wrapper and import. Receive `@rslint/core` exports from the factory parameter.
9-
3. Replace custom `--config` paths with the migrated `rstack.config.*` path.
10-
4. Remove `@rslint/core` only when no uncovered direct runtime API remains. Delete `rslint.config.*`.
11-
5. If tracked VS Code configuration recommends `rstack.rslint`, replace it with the unified `rstack.rstack` extension. Move relevant `rslint.*` settings to their current `rstack.rslint.*` equivalents according to the [Rstack extension documentation](https://github.com/rstackjs/rstack-editor/blob/main/packages/vscode/README.md). Keep `source.fixAll.rslint` unchanged.
9+
3. If the old config imports the `globals` package for environment maps such as `globals.browser`, receive `globals` from the factory parameter instead. Remove the direct `globals` dependency after confirming that no other file uses it.
10+
4. Replace custom `--config` paths with the migrated `rstack.config.*` path.
11+
5. Remove `@rslint/core` only when no uncovered direct runtime API remains. Delete `rslint.config.*`.
12+
6. If tracked VS Code configuration recommends `rstack.rslint`, replace it with the unified `rstack.rstack` extension. Move relevant `rslint.*` settings to their current `rstack.rslint.*` equivalents according to the [Rstack extension documentation](https://github.com/rstackjs/rstack-editor/blob/main/packages/vscode/README.md). Keep `source.fixAll.rslint` unchanged.
1213

1314
## Config Pattern
1415

@@ -23,6 +24,19 @@ define.lint(({ js, ts }) => [
2324

2425
Preserve existing presets and rules during migration.
2526

27+
The factory also provides Rslint's built-in globals catalog, so an external `globals` import is unnecessary:
28+
29+
```ts
30+
define.lint(({ globals }) => [
31+
{
32+
files: ['**/*.{js,cjs,mjs}'],
33+
languageOptions: {
34+
globals: globals.browser,
35+
},
36+
},
37+
]);
38+
```
39+
2640
## Script Pattern
2741

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

0 commit comments

Comments
 (0)