From a25481494398ff03904151a9d378e59a5cd93be3 Mon Sep 17 00:00:00 2001 From: neverland Date: Thu, 20 Aug 2026 21:48:58 +0800 Subject: [PATCH 1/2] chore: set up Rstack pre-commit hooks --- .rstack/hooks/pre-commit | 1 + package.json | 1 + playground/rstack.config.ts | 1 + rstack.config.ts | 12 +++++++++--- 4 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 .rstack/hooks/pre-commit diff --git a/.rstack/hooks/pre-commit b/.rstack/hooks/pre-commit new file mode 100644 index 0000000..8890b96 --- /dev/null +++ b/.rstack/hooks/pre-commit @@ -0,0 +1 @@ +rs staged diff --git a/package.json b/package.json index 98979ac..d0f2e61 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "dev": "rs lib -w", "format": "rs fmt", "lint": "rs lint", + "prepare": "rs setup", "test": "rs test" }, "devDependencies": { diff --git a/playground/rstack.config.ts b/playground/rstack.config.ts index 5b77eee..77da6f2 100644 --- a/playground/rstack.config.ts +++ b/playground/rstack.config.ts @@ -1,3 +1,4 @@ +// Configuration guide: https://rstack.rs/config import { define } from 'rstack'; define.app(async () => { diff --git a/rstack.config.ts b/rstack.config.ts index eb465ca..3c7cd81 100644 --- a/rstack.config.ts +++ b/rstack.config.ts @@ -1,13 +1,19 @@ +// Configuration guide: https://rstack.rs/config import { define } from 'rstack'; +define.lib({ + dts: true, + syntax: 'es2023', +}); + define.fmt({ singleQuote: true, sortPackageJson: true, }); -define.lib({ - dts: true, - syntax: 'es2023', +define.staged({ + '*.{js,jsx,ts,tsx,mjs,cjs,mts,cts}': ['rs lint', 'rs fmt'], + '*.{json,md,mdx,css,sass,scss,less,html,yml,yaml}': 'rs fmt', }); define.lint(({ globals, js, ts }) => [ From 45e8753e512abf41b8cbd4168b01687b98404cfd Mon Sep 17 00:00:00 2001 From: neverland Date: Thu, 20 Aug 2026 21:51:49 +0800 Subject: [PATCH 2/2] chore: remove Sass from staged formatting --- rstack.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rstack.config.ts b/rstack.config.ts index 3c7cd81..8b7a552 100644 --- a/rstack.config.ts +++ b/rstack.config.ts @@ -13,7 +13,7 @@ define.fmt({ define.staged({ '*.{js,jsx,ts,tsx,mjs,cjs,mts,cts}': ['rs lint', 'rs fmt'], - '*.{json,md,mdx,css,sass,scss,less,html,yml,yaml}': 'rs fmt', + '*.{json,md,mdx,css,scss,less,html,yml,yaml}': 'rs fmt', }); define.lint(({ globals, js, ts }) => [