Skip to content

Commit f16cdbc

Browse files
committed
chore: add husky and lint-staged for pre-commit lint, type-check, prettier
1 parent 628152b commit f16cdbc

4 files changed

Lines changed: 308 additions & 7 deletions

File tree

.husky/pre-commit

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

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,23 @@
1010
"lint": "pnpm -r run lint",
1111
"type-check": "pnpm -r run type-check",
1212
"prettier": "prettier --write .",
13+
"prepare": "husky",
1314
"publish:all": "node scripts/publish.js"
1415
},
1516
"devDependencies": {
1617
"@changesets/cli": "^2.29.8",
1718
"@types/node": "^22.19.7",
1819
"dotenv": "^16.6.1",
20+
"husky": "^9.1.7",
21+
"lint-staged": "^15.4.3",
1922
"prettier": "^3.8.1",
2023
"tsup": "^8.5.1",
2124
"typescript": "^5.9.3",
2225
"vitest": "^2.1.9"
2326
},
27+
"lint-staged": {
28+
"*.{ts,tsx,js,jsx,json,md,yml,yaml}": "prettier --write"
29+
},
2430
"publishConfig": {
2531
"registry": "https://registry.npmjs.org",
2632
"access": "public"

packages/seekdb/src/connection.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,7 @@ export class Connection {
5353
if (this.config.queryTimeout != null) {
5454
try {
5555
const timeoutUs = this.config.queryTimeout * 1000;
56-
await this.connection.query(
57-
`SET ob_query_timeout = ${timeoutUs}`
58-
);
56+
await this.connection.query(`SET ob_query_timeout = ${timeoutUs}`);
5957
} catch {
6058
// Ignore if server does not support ob_query_timeout (e.g. plain MySQL)
6159
}

0 commit comments

Comments
 (0)