Skip to content

Commit 39a0c41

Browse files
committed
fix: remove file arguments from staged lint commands
- Remove file argument passing from lintStaged function to prevent incorrect command generation like 'pnpm lint file1.ts file2.ts'. - Now commands are executed as-is, allowing lint tools to handle file discovery internally.
1 parent a6cd4c3 commit 39a0c41

File tree

5 files changed

+1712
-892
lines changed

5 files changed

+1712
-892
lines changed

basis.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ export default defineBasisConfig({
1616
},
1717
git: {
1818
hooks: {
19-
"pre-commit": "pnpm exec basis lint --staged",
20-
"commit-msg": "pnpm exec basis git --lint-commit",
19+
"pre-commit": "pnpm basis lint --staged",
20+
"commit-msg": "pnpm basis git --lint-commit",
2121
},
2222
commitMsg: {},
2323
},

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@
4646
"devDependencies": {
4747
"@funish/basis": "workspace:*",
4848
"@prettier/plugin-oxc": "0.0.4",
49-
"@types/node": "24.0.10",
50-
"oxlint": "1.5.0",
49+
"@types/node": "24.8.1",
50+
"oxlint": "1.23.0",
5151
"prettier": "3.6.2",
52-
"unbuild": "3.5.0"
52+
"unbuild": "3.6.1"
5353
},
54-
"packageManager": "pnpm@10.12.4"
54+
"packageManager": "pnpm@10.18.3+sha512.bbd16e6d7286fd7e01f6b3c0b3c932cda2965c06a908328f74663f10a9aea51f1129eea615134bf992831b009eabe167ecb7008b597f40ff9bc75946aadfb08d"
5555
}

packages/basis/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@funish/basis",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"description": "A unified development toolkit with CLI for package management, versioning, publishing, linting, and git hooks management for JavaScript/TypeScript projects.",
55
"main": "dist/index.mjs",
66
"types": "dist/index.d.ts",

packages/basis/src/modules/lint.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,10 @@ export async function lintStaged(
9898

9999
if (matchedFiles.length === 0) continue;
100100

101-
consola.start(`Linting ${matchedFiles.length} files: ${pattern}`);
101+
consola.start(`Running staged lint for pattern: ${pattern}`);
102102

103103
try {
104-
const fullCommand = `${command} ${matchedFiles.join(" ")}`;
105-
execSync(fullCommand, {
104+
execSync(command, {
106105
stdio: "inherit",
107106
cwd: cwd,
108107
});

0 commit comments

Comments
 (0)