Skip to content

Commit 4e61e0b

Browse files
committed
ci: Improved the issue of delayed pre-commit lint error detection, resulting in rework.
Lack of code quality verification during the commit phase necessitates rework when lint errors are discovered in CI. Added Husky and lint-staged to automatically run lint only on targets that have changed during commit. - Automatically fixable errors are fixed and committed, while unfixable errors are blocked. - Added root-level dependency installation to just deps.
1 parent 4aa815b commit 4e61e0b

File tree

4 files changed

+255
-7
lines changed

4 files changed

+255
-7
lines changed

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx lint-staged

.lintstagedrc.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
"src/extension/**/*.ts": () => "just lint extension",
3+
"src/web-view/**/*.{ts,tsx}": () => "just lint web-view",
4+
"**/*.{json,yml,yaml,md}": () => "just lint config",
5+
justfile: () => "just lint justfile",
6+
};

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,8 @@
271271
"devDependencies": {
272272
"@vscode/vsce": "3.6.2",
273273
"ovsx": "0.10.6",
274-
"prettier": "3.6.2"
274+
"prettier": "3.6.2",
275+
"husky": "9.1.7",
276+
"lint-staged": "15.2.11"
275277
}
276278
}

0 commit comments

Comments
 (0)