Skip to content

Commit 8534366

Browse files
committed
fix(lint): resolve remaining non-autofixable lint errors
Semantics-preserving: Object.prototype.hasOwnProperty.call() instead of direct hasOwnProperty access, redundant regex escapes dropped, comments in empty blocks, a dead `info.version;` expression removed, and two targeted eslint-disable comments (this-alias in a test fixture, async promise executor in s3-utils download).
1 parent 5ed9416 commit 8534366

19 files changed

Lines changed: 72 additions & 30 deletions

File tree

graphile/graphile-llm/src/__tests__/graphile-llm.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1067,7 +1067,11 @@ describe('Real Ollama + unifiedSearch + pgvector RRF integration', () => {
10671067

10681068
afterAll(async () => {
10691069
if (db) {
1070-
try { await db.client.query('ROLLBACK'); } catch {}
1070+
try {
1071+
await db.client.query('ROLLBACK');
1072+
} catch {
1073+
// ignore
1074+
}
10711075
}
10721076
if (teardown) await teardown();
10731077
});

graphile/graphile-presigned-url-plugin/src/plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const MAX_CONTENT_HASH_LENGTH = 128;
3535
const MAX_CONTENT_TYPE_LENGTH = 255;
3636
const MAX_CUSTOM_KEY_LENGTH = 1024;
3737
const SHA256_HEX_REGEX = /^[a-f0-9]{64}$/;
38-
const CUSTOM_KEY_REGEX = /^[a-zA-Z0-9][a-zA-Z0-9_.\-\/]*$/;
38+
const CUSTOM_KEY_REGEX = /^[a-zA-Z0-9][a-zA-Z0-9_.\-/]*$/;
3939

4040
// --- Helpers ---
4141

graphile/graphile-search/src/__tests__/rrf-scoring.test.ts

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,11 @@ describe('RRF scoring — single adapter scenarios', () => {
169169

170170
afterAll(async () => {
171171
if (db) {
172-
try { await db.client.query('ROLLBACK'); } catch {}
172+
try {
173+
await db.client.query('ROLLBACK');
174+
} catch {
175+
// ignore
176+
}
173177
}
174178
if (teardown) await teardown();
175179
});
@@ -362,7 +366,11 @@ describe('RRF scoring — multi-adapter combinations', () => {
362366

363367
afterAll(async () => {
364368
if (db) {
365-
try { await db.client.query('ROLLBACK'); } catch {}
369+
try {
370+
await db.client.query('ROLLBACK');
371+
} catch {
372+
// ignore
373+
}
366374
}
367375
if (teardown) await teardown();
368376
});
@@ -605,7 +613,11 @@ describe('RRF scoring — unifiedSearch + pgvector fusion (simulating LLM path)'
605613

606614
afterAll(async () => {
607615
if (db) {
608-
try { await db.client.query('ROLLBACK'); } catch {}
616+
try {
617+
await db.client.query('ROLLBACK');
618+
} catch {
619+
// ignore
620+
}
609621
}
610622
if (teardown) await teardown();
611623
});
@@ -793,7 +805,11 @@ describe('RRF scoring — chunk-aware tables', () => {
793805

794806
afterAll(async () => {
795807
if (db) {
796-
try { await db.client.query('ROLLBACK'); } catch {}
808+
try {
809+
await db.client.query('ROLLBACK');
810+
} catch {
811+
// ignore
812+
}
797813
}
798814
if (teardown) await teardown();
799815
});
@@ -965,7 +981,11 @@ describe('RRF scoring — custom @searchConfig weights', () => {
965981

966982
afterAll(async () => {
967983
if (db) {
968-
try { await db.client.query('ROLLBACK'); } catch {}
984+
try {
985+
await db.client.query('ROLLBACK');
986+
} catch {
987+
// ignore
988+
}
969989
}
970990
if (teardown) await teardown();
971991
});
@@ -1090,7 +1110,11 @@ describe('RRF scoring — recency boost', () => {
10901110

10911111
afterAll(async () => {
10921112
if (db) {
1093-
try { await db.client.query('ROLLBACK'); } catch {}
1113+
try {
1114+
await db.client.query('ROLLBACK');
1115+
} catch {
1116+
// ignore
1117+
}
10941118
}
10951119
if (teardown) await teardown();
10961120
});
@@ -1209,7 +1233,11 @@ describe('RRF scoring — custom rrfK parameter', () => {
12091233

12101234
afterAll(async () => {
12111235
if (db) {
1212-
try { await db.client.query('ROLLBACK'); } catch {}
1236+
try {
1237+
await db.client.query('ROLLBACK');
1238+
} catch {
1239+
// ignore
1240+
}
12131241
}
12141242
if (teardown) await teardown();
12151243
});

pgpm/ast/__tests__/plan-rename.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ describe('renameInPlanContent', () => {
7878
expect(out).toContain(`schemas/mod_${n - 1}/tables/t_${n - 1}`);
7979
expect(out).toContain('[schemas/mod_0/tables/t_0]');
8080
// No hyphenated change tokens should remain (metadata/comments still have them).
81-
expect(out).not.toMatch(/(^|[\s\[])schemas\/mod-\d/m);
81+
expect(out).not.toMatch(/(^|[\s[])schemas\/mod-\d/m);
8282
expect(elapsedMs).toBeLessThan(2000);
8383
});
8484
});

pgpm/ast/src/files/extension/reader.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ export function parseControlContent(contents: string): { requires: string[]; ver
3636
.find((line) => /^requires/.test(line))
3737
?.split('=')[1]
3838
.split(',')
39-
.map((req) => req.replace(/[\'\s]*/g, '').trim()) || [];
39+
.map((req) => req.replace(/['\s]*/g, '').trim()) || [];
4040

4141
const version = contents
4242
.split('\n')
4343
.find((line) => /^default_version/.test(line))
4444
?.split('=')[1]
45-
.replace(/[\']*/g, '')
45+
.replace(/[']*/g, '')
4646
.trim() || '';
4747

4848
return { requires, version };

pgpm/ast/src/files/sql/header.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ export function scanDeployScript(
241241
}
242242

243243
if (/:/.test(line)) {
244-
const m2 = line.match(/^-- Deploy ([^:]*):([\w\/]+)(?:\s+to\s+pg)?/);
244+
const m2 = line.match(/^-- Deploy ([^:]*):([\w/]+)(?:\s+to\s+pg)?/);
245245
if (m2) {
246246
const actualProject = m2[1];
247247
const keyToTest = m2[2];

pgpm/ast/src/plan-rename.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function renameInPlanContent(content: string, renames: Map<string, string
1818
if (renames.size === 0) return content;
1919

2020
// One regex, compiled once per call (not per line or per rename).
21-
const tokenRe = /(^|[\s\[])([^\s\[\]@]+)(?=$|[\s\]@])/g;
21+
const tokenRe = /(^|[\s[])([^\s[\]@]+)(?=$|[\s\]@])/g;
2222

2323
return content
2424
.split('\n')

pgpm/cli/src/commands/package.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ export default async (
134134
project.ensureModule();
135135

136136
const info = project.getModuleInfo();
137-
info.version;
138137

139138
await writePackage({
140139
version: info.version,

pgpm/core/src/core/class/pgpm.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,9 @@ export class PgpmPackage {
765765
}
766766
}
767767
}
768-
} catch {}
768+
} catch {
769+
// ignore
770+
}
769771
}
770772

771773
if (!hasTagDependency && !deps[firstKey].includes(depToken)) {

pgpm/core/src/migrate/clean.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { deparse,parse } from 'pgsql-parser';
44
const filterStatements = (stmts: RawStmt[]): { filteredStmts: RawStmt[], hasFiltered: boolean } => {
55
const filteredStmts = stmts.filter(node => {
66
const stmt = node.stmt;
7-
return stmt && !stmt.hasOwnProperty('TransactionStmt');
7+
return stmt && !Object.prototype.hasOwnProperty.call(stmt, 'TransactionStmt');
88
});
99

1010
const hasFiltered = filteredStmts.length !== stmts.length;

0 commit comments

Comments
 (0)