Skip to content

Commit 12da47d

Browse files
authored
chore: migrate Rslint to Rstack CLI (#8164)
1 parent dd9e690 commit 12da47d

6 files changed

Lines changed: 94 additions & 41 deletions

File tree

e2e/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This folder contains the E2E test cases of Rsbuild. The E2E suite is powered by
77
- `cases`: Test cases covering different Rsbuild features.
88
- `assets`: Common static assets, can be accessed using the `@e2e/assets` package.
99
- `scripts`: Shared helpers, can be accessed using the `@e2e/helper` package.
10-
- `type-tests`: Test cases for type checking, checked via `rslint --type-check`.
10+
- `type-tests`: Test cases for type checking, checked via `rs lint --type-check`.
1111

1212
## Commands
1313

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,14 @@
1313
"e2e": "cd ./e2e && pnpm e2e",
1414
"format": "oxfmt . && heading-case --write",
1515
"format:check": "oxfmt . --check",
16-
"lint": "rslint --type-check",
16+
"lint": "rs lint --type-check",
1717
"prebundle": "pnpm --parallel --filter \"./packages/*\" run prebundle",
1818
"prepare": "simple-git-hooks && node --run prebundle",
1919
"sort-package-json": "pnpx sort-package-json \"./package.json\" \"packages/*/package.json\"",
2020
"test": "rstest",
2121
"test:watch": "rstest watch"
2222
},
2323
"devDependencies": {
24-
"@rslint/core": "catalog:",
2524
"@rstest/adapter-rslib": "catalog:",
2625
"@rstest/core": "catalog:",
2726
"@scripts/config": "workspace:*",
@@ -32,6 +31,7 @@
3231
"heading-case": "catalog:",
3332
"nano-staged": "catalog:",
3433
"oxfmt": "catalog:",
34+
"rstack": "catalog:",
3535
"simple-git-hooks": "catalog:",
3636
"typescript": "catalog:"
3737
},
@@ -41,7 +41,7 @@
4141
"nano-staged": {
4242
"*.{md,mdx,json,css,less,scss}": "oxfmt --no-error-on-unmatched-pattern",
4343
"*.{js,jsx,ts,tsx,mjs,cjs}": [
44-
"rslint --type-check",
44+
"rs lint --type-check",
4545
"oxfmt --no-error-on-unmatched-pattern"
4646
]
4747
},

pnpm-lock.yaml

Lines changed: 58 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ catalog:
3333
'@rsbuild/plugin-rem': '^1.0.6'
3434
'@rsbuild/plugin-type-check': '^1.5.0'
3535
'@rslib/core': '1.0.0-beta.0'
36-
'@rslint/core': '^0.7.0'
3736
'@rspack/core': '~2.1.5'
3837
'@rspack/plugin-preact-refresh': '^2.0.1'
3938
'@rspack/plugin-react-refresh': '^2.0.2'
@@ -124,6 +123,7 @@ catalog:
124123
'rspack-merge': '1.0.1'
125124
'rspack-vue-loader': '^17.6.1'
126125
'rspress-plugin-font-open-sans': '^1.0.4'
126+
'rstack': '^0.1.0'
127127
'sass': '^1.101.0'
128128
'sass-embedded': '^1.100.0'
129129
'sass-loader': '^16.0.8'
@@ -178,6 +178,7 @@ minimumReleaseAgeExclude:
178178
- '@rspress/*'
179179
- '@rstest/*'
180180
- '@rslint/*'
181+
- 'rstack'
181182
- '@tailwindcss/*'
182183
- 'rslog'
183184
- 'tailwindcss'

rslint.config.ts

Lines changed: 0 additions & 26 deletions
This file was deleted.

rstack.config.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { define } from 'rstack';
2+
3+
define.lint(async () => {
4+
const { globalIgnores, js, ts } = await import('rstack/lint');
5+
6+
return [
7+
globalIgnores([
8+
'e2e/cases/browser-logs/skip-build-error/src/index.js',
9+
'e2e/cases/wasm/wasm-source-import/src/index.js',
10+
]),
11+
js.configs.recommended,
12+
ts.configs.recommended,
13+
{
14+
languageOptions: {
15+
parserOptions: {
16+
project: [
17+
'./packages/*/tsconfig.json',
18+
'./scripts/*/tsconfig.json',
19+
'./examples/*/tsconfig.json',
20+
'./e2e/tsconfig.json',
21+
'./e2e/type-tests/*/tsconfig.json',
22+
],
23+
},
24+
},
25+
rules: {
26+
'@typescript-eslint/no-explicit-any': 'off',
27+
},
28+
},
29+
];
30+
});

0 commit comments

Comments
 (0)