From 1c2ca1883160a2e56aeffb6ea9a354ff9c23f606 Mon Sep 17 00:00:00 2001 From: neverland Date: Tue, 18 Aug 2026 15:22:29 +0800 Subject: [PATCH 1/2] chore(lint): enable Rstest rules --- .vscode/settings.json | 1 - examples/app-vanilla/tests/dom.test.ts | 2 +- .../create-rstack/template-app-vanilla-ts/tests/dom.test.ts | 2 +- .../create-rstack/template-app-vanilla/tests/dom.test.js | 2 +- rstack.config.ts | 6 +++++- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index a8bf25da..e82c8714 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -15,7 +15,6 @@ "mdx.validate.validateFileLinks": "ignore", "editor.defaultFormatter": "esbenp.prettier-vscode", // Temporary workaround until we switch to the Rstack VS Code extension. - "prettier.printWidth": 100, "prettier.singleQuote": true, "js/ts.tsdk.path": "node_modules/typescript/lib", "[typescript]": { diff --git a/examples/app-vanilla/tests/dom.test.ts b/examples/app-vanilla/tests/dom.test.ts index 45c267a8..181f4c43 100644 --- a/examples/app-vanilla/tests/dom.test.ts +++ b/examples/app-vanilla/tests/dom.test.ts @@ -1,7 +1,7 @@ import { expect, test } from 'rstack/test'; import { screen } from '@testing-library/dom'; -test('test dom', () => { +test('renders content', () => { document.body.innerHTML = `
Visible Example
diff --git a/packages/create-rstack/template-app-vanilla-ts/tests/dom.test.ts b/packages/create-rstack/template-app-vanilla-ts/tests/dom.test.ts index 45c267a8..181f4c43 100644 --- a/packages/create-rstack/template-app-vanilla-ts/tests/dom.test.ts +++ b/packages/create-rstack/template-app-vanilla-ts/tests/dom.test.ts @@ -1,7 +1,7 @@ import { expect, test } from 'rstack/test'; import { screen } from '@testing-library/dom'; -test('test dom', () => { +test('renders content', () => { document.body.innerHTML = `
Visible Example
diff --git a/packages/create-rstack/template-app-vanilla/tests/dom.test.js b/packages/create-rstack/template-app-vanilla/tests/dom.test.js index 45c267a8..181f4c43 100644 --- a/packages/create-rstack/template-app-vanilla/tests/dom.test.js +++ b/packages/create-rstack/template-app-vanilla/tests/dom.test.js @@ -1,7 +1,7 @@ import { expect, test } from 'rstack/test'; import { screen } from '@testing-library/dom'; -test('test dom', () => { +test('renders content', () => { document.body.innerHTML = `
Visible Example
diff --git a/rstack.config.ts b/rstack.config.ts index 066eace0..a4496511 100644 --- a/rstack.config.ts +++ b/rstack.config.ts @@ -1,7 +1,7 @@ // Configuration guide: https://rstack.rs/config import { define } from 'rstack'; -define.lint(async ({ js, ts }) => { +define.lint(async ({ js, ts, rstestPlugin }) => { const { default: globals } = await import('globals'); return [ js.configs.recommended, @@ -18,6 +18,10 @@ define.lint(async ({ js, ts }) => { }, }, }, + { + files: ['**/*.test.ts'], + ...rstestPlugin.configs.recommended, + }, // Source imports use .ts for Node.js native TypeScript execution; builds rewrite them to .js. { files: ['packages/rstack/src/**/*.ts'], From 4f11c3c4a4b9080445661ab1e38bc67eabd05c50 Mon Sep 17 00:00:00 2001 From: neverland Date: Tue, 18 Aug 2026 15:30:43 +0800 Subject: [PATCH 2/2] fix(lint): include TSX tests in Rstest rules --- rstack.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rstack.config.ts b/rstack.config.ts index a4496511..5555e567 100644 --- a/rstack.config.ts +++ b/rstack.config.ts @@ -19,7 +19,7 @@ define.lint(async ({ js, ts, rstestPlugin }) => { }, }, { - files: ['**/*.test.ts'], + files: ['**/*.test.{ts,tsx}'], ...rstestPlugin.configs.recommended, }, // Source imports use .ts for Node.js native TypeScript execution; builds rewrite them to .js.