Skip to content

Commit 5fb54cc

Browse files
committed
chore: fix lint errors, format code, and configure husky
1 parent dbd318f commit 5fb54cc

9 files changed

Lines changed: 217 additions & 119 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@ jobs:
3838
- name: Build
3939
run: pnpm build
4040

41-
- name: Test
42-
run: pnpm test
41+
- name: Test Coverage Gate
42+
run: pnpm test:coverage
4343

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pnpm run validate

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@
1717
"format": "pnpm -r run format",
1818
"format:check": "pnpm -r run format:check",
1919
"typecheck": "pnpm -r run typecheck",
20-
"validate": "pnpm -r run validate"
20+
"validate": "pnpm -r run validate",
21+
"prepare": "husky"
2122
},
2223
"devDependencies": {
2324
"@types/node": "^22.15.29",
2425
"@types/source-map": "^0.5.7",
2526
"eslint": "^9.31.0",
27+
"husky": "^9.1.7",
2628
"jiti": "^2.4.2",
2729
"prettier": "^3.5.0",
2830
"typescript": "^5.8.3",

packages/agent/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"format:check": "prettier --check .",
4141
"test": "node --test --experimental-strip-types tests/**/*.test.ts tests/*.test.ts",
4242
"test:watch": "node --test --experimental-strip-types --watch tests/**/*.test.ts tests/*.test.ts",
43-
"test:coverage": "node --test --experimental-test-coverage --test-coverage-lines=80 --test-coverage-functions=80 --test-coverage-branches=70 --experimental-strip-types tests/**/*.test.ts tests/*.test.ts",
43+
"test:coverage": "node --test --experimental-test-coverage --test-coverage-lines=100 --test-coverage-functions=100 --test-coverage-branches=100 --experimental-strip-types tests/**/*.test.ts tests/*.test.ts",
4444
"validate": "pnpm run typecheck && pnpm run lint && pnpm run format:check && pnpm run test:coverage",
4545
"prepublishOnly": "node -e \"require('fs').copyFileSync('../../README.md','./README.md')\" && pnpm run build",
4646
"postpublish": "node -e \"require('fs').unlinkSync('./README.md')\""

packages/agent/src/argus-agent.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -855,8 +855,8 @@ export class ArgusAgent extends EventEmitter {
855855
Promise.all(scanDone)
856856
.catch((err: Error) => this.emit("error", err))
857857
.finally(() => {
858-
if (this.fsTracker) this.fsTracker.resume();
859-
});
858+
if (this.fsTracker) this.fsTracker.resume();
859+
});
860860

861861
if (this.indexHintsDir) {
862862
new MigrationScanner()

packages/agent/src/instrumentation/fs.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,12 @@ export class FsInstrumentation extends EventEmitter {
9999
};
100100
}
101101

102-
public suppress(): void { this.suppressed = true; }
103-
public resume(): void { this.suppressed = false; }
102+
public suppress(): void {
103+
this.suppressed = true;
104+
}
105+
public resume(): void {
106+
this.suppressed = false;
107+
}
104108

105109
private record(method: string, path: string, start: number, sourceLine?: string) {
106110
if (this.suppressed) return;

0 commit comments

Comments
 (0)