From d16e82fb6db70c4b65c3a4229a60f84de04fe63a Mon Sep 17 00:00:00 2001 From: neverland Date: Wed, 12 Aug 2026 17:34:25 +0800 Subject: [PATCH 1/5] chore(deps): upgrade Rslint to v0.8.0 --- package.json | 1 + pnpm-lock.yaml | 88 +++++++++++++++++++++++++-------------------- pnpm-workspace.yaml | 3 +- rstack.config.ts | 32 +++++++++++++++++ 4 files changed, 85 insertions(+), 39 deletions(-) diff --git a/package.json b/package.json index 9c823b40..682f4b0a 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "devDependencies": { "@types/node": "catalog:", "cspell-ban-words": "catalog:", + "globals": "catalog:", "heading-case": "catalog:", "prettier": "catalog:", "rstack": "workspace:*", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b1d9b06d..c3ad4f86 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -23,8 +23,8 @@ catalogs: specifier: ~1.0.0-beta.2 version: 1.0.0-beta.2 '@rslint/core': - specifier: ~0.7.3 - version: 0.7.3 + specifier: ~0.8.0 + version: 0.8.0 '@rspress/core': specifier: ^2.0.19 version: 2.0.19 @@ -85,6 +85,9 @@ catalogs: fast-json-stable-stringify: specifier: 2.1.0 version: 2.1.0 + globals: + specifier: ^17.7.0 + version: 17.9.0 happy-dom: specifier: ^20.11.2 version: 20.11.2 @@ -159,6 +162,9 @@ importers: cspell-ban-words: specifier: 'catalog:' version: 0.0.4 + globals: + specifier: 'catalog:' + version: 17.9.0 heading-case: specifier: 'catalog:' version: 1.1.5 @@ -366,7 +372,7 @@ importers: version: 1.0.0-beta.2(typescript@7.0.2) '@rslint/core': specifier: 'catalog:' - version: 0.7.3 + version: 0.8.0 '@rstest/core': specifier: 'catalog:' version: 0.11.6(happy-dom@20.11.2) @@ -1298,8 +1304,8 @@ packages: typescript: optional: true - '@rslint/core@0.7.3': - resolution: {integrity: sha512-vRg6dOzyTie/fMOfvQ+4v3CoZ+IMyAfWyFC9bYf2QiKOV+csE/JHTV+yvh68YAEZvsDuQr35+8yerJFYLaFMPw==} + '@rslint/core@0.8.0': + resolution: {integrity: sha512-MfMC6lxiXoKPWsYRu9fuAxWA9mCD/I4E5Aa6Sl20a6q5w8r2C12fJM+bceC01AMGYuvWygKHqS3QBJdJHjniRw==} hasBin: true peerDependencies: jiti: ^2.7.0 @@ -1307,47 +1313,47 @@ packages: jiti: optional: true - '@rslint/native-darwin-arm64@0.7.3': - resolution: {integrity: sha512-BJOWoF5lD+6Kyigxfo38rXviS5cvHgZwQJ2zOjAal2Xiv2mn8Il88KGs8M/KwWNryFcQPGp5wjk6i6uPHwYb1w==} + '@rslint/native-darwin-arm64@0.8.0': + resolution: {integrity: sha512-Bo6kXL1/TkjVUl6maZ3Sw+JEnZUkgpUD35v06jyBTcjpxlXE6yqFj66NAzB/G2CVu220ADp/FEE7l2Kocrefhg==} cpu: [arm64] os: [darwin] - '@rslint/native-darwin-x64@0.7.3': - resolution: {integrity: sha512-3WIJocfinQs9YkzqgNXBIQNOylpz4IUI6LPzARE4tUJz9GgZF9Q7IEuscpVgkVUkh/P+Pr4CUplivggzXiBFBw==} + '@rslint/native-darwin-x64@0.8.0': + resolution: {integrity: sha512-F5pabdH7dluxoj7PGuQjPYuoNU+yxnctcJzqrb/CZ122FLP3uJPrbiLufh+ZF9e5ui700rNyb7macJqnHlBV2w==} cpu: [x64] os: [darwin] - '@rslint/native-linux-arm64-gnu@0.7.3': - resolution: {integrity: sha512-lLKQ+A/GiTvzOjtiK0euWul40nmQziR925JXznqcXgT0g1UdU7FwWdcy6l/UCQW8aVgzycV8yJMdaKmz+6H7Vg==} + '@rslint/native-linux-arm64-gnu@0.8.0': + resolution: {integrity: sha512-SSgSjyaeXI032Wk8bq6VmkLQTWOEqHZH5MWAk3831pd/G2rWr2XcoDi5Wf6w0o2rSCeYzkYbIejOePYwIKT4Lg==} cpu: [arm64] os: [linux] libc: [glibc] - '@rslint/native-linux-arm64-musl@0.7.3': - resolution: {integrity: sha512-i6jVTIii8eIHFfb/UNMNRvZGPiW/yH4ZgfX/+77kxAnAYHm0wx2qXakW9M8LDTdtCz1UBqV0UL7NB4gBQyDPwQ==} + '@rslint/native-linux-arm64-musl@0.8.0': + resolution: {integrity: sha512-50VDZQFAc9kp6rbOUOjyppVjC3d3AdbOJyA6JxlhK3mp8a/8sPIqWG0BlfcN/7ZpwdZrFsQt2Ds+0yMXITfu5A==} cpu: [arm64] os: [linux] libc: [musl] - '@rslint/native-linux-x64-gnu@0.7.3': - resolution: {integrity: sha512-Qta8uiB4c3zuLK/1pCgx9DzhtCvQ/i31TDoNSA3WpY17Tsa82CGXho1l6bCA1/9dbuOz5lwCsYALQLVe8/o/rQ==} + '@rslint/native-linux-x64-gnu@0.8.0': + resolution: {integrity: sha512-wfc/UfnuTBAofwLPK5MLB2Hus1YYnsxP2MVchp380fUvMfQuGFPzz1WOAUY66zqrsrDKpUJsh3V1bx7c8DTlJA==} cpu: [x64] os: [linux] libc: [glibc] - '@rslint/native-linux-x64-musl@0.7.3': - resolution: {integrity: sha512-urpqLlJISIFAtiXCGGwRZgfnSYpFDi5lzk6ibSgBPvJmv94yhxMpDoutpHTA3UyVDeH33axYGRonImLf7UfBSA==} + '@rslint/native-linux-x64-musl@0.8.0': + resolution: {integrity: sha512-MTYcAMz6IZWb6ZmLo12pakCBA8mS3EW9cOI0jd3At6vs0Yia9YbeOAUiWbIC4Z9yyp75b8ZQCQMRSnY6rDnbaA==} cpu: [x64] os: [linux] libc: [musl] - '@rslint/native-win32-arm64-msvc@0.7.3': - resolution: {integrity: sha512-jcxjgUPMl725p0wjXLPIPMeARK41FwHXiWVmg4AqIHJBfpXpwM+xozVn4Dd5GL3TO38zjmP881bKOvtPwnFl0Q==} + '@rslint/native-win32-arm64-msvc@0.8.0': + resolution: {integrity: sha512-hids2jgNWBxZf2mSBLZJxubWRLWlJapEfeJHVokzjpRpBZZNv7O06enoyXSb4Lswff9WaHssIqu1sfZIc9lC2g==} cpu: [arm64] os: [win32] - '@rslint/native-win32-x64-msvc@0.7.3': - resolution: {integrity: sha512-R87nmvTUZry9DPF8Cz6TGLLAikIyUxHDPwzonrYaJ0kTLeJAgDMfVIY1s5pUxF3heQD6G2QXjhpU/uPwqnvmzg==} + '@rslint/native-win32-x64-msvc@0.8.0': + resolution: {integrity: sha512-bun7uURKl6NdChwmw/i2mk3Yj9klZQyh1uRbIQG0RDEJ9oTIbU5M3c7K5sd/Rukat0TVCGgbBAzR+YB0DAXPZQ==} cpu: [x64] os: [win32] @@ -2141,6 +2147,10 @@ packages: git-hooks-list@4.2.1: resolution: {integrity: sha512-WNvqJjOxxs/8ZP9+DWdwWJ7cDsd60NHf39XnD82pDVrKO5q7xfPqpkK6hwEAmBa/ZSEE4IOoR75EzbbIuwGlMw==} + globals@17.9.0: + resolution: {integrity: sha512-m/MvAW61QVU5VDNF1Vj8axt016h8w7L5TU1e9zlab7XIttAT2YAlCwl75K1fOqvMM9apmD7lbCIRhpfkhmxhCg==} + engines: {node: '>=18'} + happy-dom@20.11.2: resolution: {integrity: sha512-7MB+bJLkxu3SowAfBJbjW+c55kNz5tkR45gu2qzrxznezhLeN5YIlJbwUgSzlGc+qWoZ8Ykg71H5ezz69xixrw==} engines: {node: '>=20.0.0'} @@ -3786,41 +3796,41 @@ snapshots: - '@module-federation/runtime-tools' - core-js - '@rslint/core@0.7.3': + '@rslint/core@0.8.0': dependencies: picomatch: 4.0.5 optionalDependencies: - '@rslint/native-darwin-arm64': 0.7.3 - '@rslint/native-darwin-x64': 0.7.3 - '@rslint/native-linux-arm64-gnu': 0.7.3 - '@rslint/native-linux-arm64-musl': 0.7.3 - '@rslint/native-linux-x64-gnu': 0.7.3 - '@rslint/native-linux-x64-musl': 0.7.3 - '@rslint/native-win32-arm64-msvc': 0.7.3 - '@rslint/native-win32-x64-msvc': 0.7.3 + '@rslint/native-darwin-arm64': 0.8.0 + '@rslint/native-darwin-x64': 0.8.0 + '@rslint/native-linux-arm64-gnu': 0.8.0 + '@rslint/native-linux-arm64-musl': 0.8.0 + '@rslint/native-linux-x64-gnu': 0.8.0 + '@rslint/native-linux-x64-musl': 0.8.0 + '@rslint/native-win32-arm64-msvc': 0.8.0 + '@rslint/native-win32-x64-msvc': 0.8.0 - '@rslint/native-darwin-arm64@0.7.3': + '@rslint/native-darwin-arm64@0.8.0': optional: true - '@rslint/native-darwin-x64@0.7.3': + '@rslint/native-darwin-x64@0.8.0': optional: true - '@rslint/native-linux-arm64-gnu@0.7.3': + '@rslint/native-linux-arm64-gnu@0.8.0': optional: true - '@rslint/native-linux-arm64-musl@0.7.3': + '@rslint/native-linux-arm64-musl@0.8.0': optional: true - '@rslint/native-linux-x64-gnu@0.7.3': + '@rslint/native-linux-x64-gnu@0.8.0': optional: true - '@rslint/native-linux-x64-musl@0.7.3': + '@rslint/native-linux-x64-musl@0.8.0': optional: true - '@rslint/native-win32-arm64-msvc@0.7.3': + '@rslint/native-win32-arm64-msvc@0.8.0': optional: true - '@rslint/native-win32-x64-msvc@0.7.3': + '@rslint/native-win32-x64-msvc@0.8.0': optional: true '@rspack/binding-darwin-arm64@2.1.8': @@ -4492,6 +4502,8 @@ snapshots: git-hooks-list@4.2.1: {} + globals@17.9.0: {} + happy-dom@20.11.2: dependencies: '@types/node': 24.13.3 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index d91cd99d..460655d2 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -17,7 +17,7 @@ catalog: '@rsbuild/plugin-react': '^2.1.0' '@rsbuild/plugin-sass': '^2.0.1' '@rslib/core': '~1.0.0-beta.2' - '@rslint/core': '~0.7.3' + '@rslint/core': '~0.8.0' '@rspress/core': '^2.0.19' '@rspress/plugin-client-redirects': '^2.0.19' '@rspress/plugin-sitemap': '^2.0.19' @@ -38,6 +38,7 @@ catalog: '@shikijs/transformers': '^4.4.2' 'cspell-ban-words': '^0.0.4' 'fast-json-stable-stringify': '2.1.0' + globals: '^17.7.0' 'happy-dom': '^20.11.2' 'heading-case': '^1.1.5' 'import-meta-resolve': '4.2.0' diff --git a/rstack.config.ts b/rstack.config.ts index 9ffac863..9c3ad509 100644 --- a/rstack.config.ts +++ b/rstack.config.ts @@ -1,4 +1,5 @@ // Rstack configuration guide: https://rstack.rs/config +import globals from 'globals'; import { define } from 'rstack'; define.lint(async () => { @@ -6,6 +7,37 @@ define.lint(async () => { return [ js.configs.recommended, ts.configs.recommended, + { + files: [ + '**/*.config.{js,cjs,mjs}', + '.agents/skills/**/scripts/**/*.{js,cjs,mjs}', + 'packages/rstack/bin/**/*.{js,cjs,mjs}', + 'scripts/**/*.{js,cjs,mjs}', + ], + languageOptions: { + globals: globals.node, + }, + }, + { + files: [ + 'packages/create-rstack/template-app-*/{src,tests}/**/*.{js,jsx}', + 'packages/create-rstack/template-lib-{react,solid,svelte,vue}/{src,tests}/**/*.{js,jsx}', + ], + languageOptions: { + globals: globals.browser, + }, + }, + { + files: ['packages/rstack/tests/**/src/**/*.js'], + languageOptions: { + globals: { + ...globals.browser, + DEFINE_APP_TEST_VALUE: 'readonly', + DEFINE_LIB_TEST_VALUE: 'readonly', + DEFINE_VALUE: 'readonly', + }, + }, + }, // Source imports use .ts for Node.js native TypeScript execution; builds rewrite them to .js. { files: ['packages/rstack/src/**/*.ts'], From 00e0bcb5bed594448e2af6e95cad503063fb59d4 Mon Sep 17 00:00:00 2001 From: neverland Date: Wed, 12 Aug 2026 17:38:24 +0800 Subject: [PATCH 2/5] refactor: simplify lint globals config --- rstack.config.ts | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/rstack.config.ts b/rstack.config.ts index 9c3ad509..8a38650b 100644 --- a/rstack.config.ts +++ b/rstack.config.ts @@ -8,30 +8,11 @@ define.lint(async () => { js.configs.recommended, ts.configs.recommended, { - files: [ - '**/*.config.{js,cjs,mjs}', - '.agents/skills/**/scripts/**/*.{js,cjs,mjs}', - 'packages/rstack/bin/**/*.{js,cjs,mjs}', - 'scripts/**/*.{js,cjs,mjs}', - ], - languageOptions: { - globals: globals.node, - }, - }, - { - files: [ - 'packages/create-rstack/template-app-*/{src,tests}/**/*.{js,jsx}', - 'packages/create-rstack/template-lib-{react,solid,svelte,vue}/{src,tests}/**/*.{js,jsx}', - ], - languageOptions: { - globals: globals.browser, - }, - }, - { - files: ['packages/rstack/tests/**/src/**/*.js'], + files: ['**/*.{js,jsx,cjs,mjs}'], languageOptions: { globals: { ...globals.browser, + ...globals.node, DEFINE_APP_TEST_VALUE: 'readonly', DEFINE_LIB_TEST_VALUE: 'readonly', DEFINE_VALUE: 'readonly', From 1ab181ca5d81ad688ea7e20c4293532e6261cc23 Mon Sep 17 00:00:00 2001 From: neverland Date: Wed, 12 Aug 2026 17:48:06 +0800 Subject: [PATCH 3/5] refactor: use Node builtin globals --- rstack.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rstack.config.ts b/rstack.config.ts index 8a38650b..afc03621 100644 --- a/rstack.config.ts +++ b/rstack.config.ts @@ -12,7 +12,7 @@ define.lint(async () => { languageOptions: { globals: { ...globals.browser, - ...globals.node, + ...globals.nodeBuiltin, DEFINE_APP_TEST_VALUE: 'readonly', DEFINE_LIB_TEST_VALUE: 'readonly', DEFINE_VALUE: 'readonly', From 4e6b9461b6af3cd46841a46a7e27df0e1061ea92 Mon Sep 17 00:00:00 2001 From: neverland Date: Wed, 12 Aug 2026 17:56:58 +0800 Subject: [PATCH 4/5] refactor: lazy load lint globals --- rstack.config.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rstack.config.ts b/rstack.config.ts index afc03621..21b4c11c 100644 --- a/rstack.config.ts +++ b/rstack.config.ts @@ -1,9 +1,11 @@ // Rstack configuration guide: https://rstack.rs/config -import globals from 'globals'; import { define } from 'rstack'; define.lint(async () => { - const { js, ts } = await import('rstack/lint'); + const [{ default: globals }, { js, ts }] = await Promise.all([ + import('globals'), + import('rstack/lint'), + ]); return [ js.configs.recommended, ts.configs.recommended, From b3991c7f5155f9a9a78405077fee9223071d02fe Mon Sep 17 00:00:00 2001 From: neverland Date: Wed, 12 Aug 2026 18:07:07 +0800 Subject: [PATCH 5/5] refactor: load lint dependencies sequentially --- rstack.config.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/rstack.config.ts b/rstack.config.ts index 21b4c11c..0ad535cf 100644 --- a/rstack.config.ts +++ b/rstack.config.ts @@ -2,10 +2,8 @@ import { define } from 'rstack'; define.lint(async () => { - const [{ default: globals }, { js, ts }] = await Promise.all([ - import('globals'), - import('rstack/lint'), - ]); + const { default: globals } = await import('globals'); + const { js, ts } = await import('rstack/lint'); return [ js.configs.recommended, ts.configs.recommended,