Skip to content

Commit 2b4eccc

Browse files
Merge pull request #404 from Goldii-locks/fix/remove-dead-webhook-path-add-eslint
Remove dead duplicate webhook path, add ESLint, unhide 3 test files from tsc
2 parents d41c6ba + 2127aeb commit 2b4eccc

12 files changed

Lines changed: 1301 additions & 428 deletions

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ jobs:
2222
- name: Install dependencies
2323
run: npm ci
2424

25+
- name: Lint
26+
run: npm run lint
27+
2528
- name: Type check
2629
run: npx tsc --noEmit
2730

__tests__/database-writer-pool.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ describe("DatabaseWriterPool – Concurrent Write Operations", () => {
377377
});
378378

379379
it("flushWriteQueue waits for all pending operations", async () => {
380-
let executionOrder: string[] = [];
380+
const executionOrder: string[] = [];
381381

382382
const operations = [1, 2, 3].map((num) => ({
383383
name: `operation-${num}`,

__tests__/milestone-webhook-events.test.ts

Lines changed: 0 additions & 134 deletions
This file was deleted.

__tests__/rpc-poller-client.test.ts

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -299,11 +299,7 @@ describe("RpcPollerClient – database transaction isolation", () => {
299299
return result;
300300
};
301301
const tx = testDb.transaction(wrapped);
302-
try {
303-
return tx();
304-
} catch (e) {
305-
throw e;
306-
}
302+
return tx();
307303
};
308304
Object.assign(wrappedTx, {
309305
default: () => wrappedTx(),
@@ -337,11 +333,7 @@ describe("RpcPollerClient – database transaction isolation", () => {
337333
return result;
338334
};
339335
const tx = testDb.transaction(wrapped);
340-
try {
341-
return tx();
342-
} catch (e) {
343-
throw e;
344-
}
336+
return tx();
345337
};
346338
Object.assign(wrappedTx, {
347339
default: () => wrappedTx(),
@@ -381,11 +373,7 @@ describe("RpcPollerClient – database transaction isolation", () => {
381373
return result;
382374
};
383375
const tx = testDb.transaction(wrapped);
384-
try {
385-
return tx();
386-
} catch (e) {
387-
throw e;
388-
}
376+
return tx();
389377
};
390378
Object.assign(wrappedTx, {
391379
default: () => wrappedTx(),

eslint.config.mjs

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import js from "@eslint/js";
2+
import tseslint from "typescript-eslint";
3+
4+
export default tseslint.config(
5+
{
6+
ignores: [
7+
"dist/**",
8+
"node_modules/**",
9+
"coverage/**",
10+
"eslint.config.mjs",
11+
"jest.config.js",
12+
"verify-ci.js",
13+
],
14+
},
15+
js.configs.recommended,
16+
...tseslint.configs.recommended,
17+
{
18+
languageOptions: {
19+
parserOptions: {
20+
projectService: true,
21+
tsconfigRootDir: import.meta.dirname,
22+
},
23+
},
24+
rules: {
25+
// ── Errors: these catch defects tsc does not ───────────────────────────
26+
//
27+
// `in` walks the prototype chain. That is precisely how the milestone
28+
// webhook guard let "toString" through and shipped a payload whose
29+
// newStatus was a function -- code that type-checked perfectly.
30+
"no-prototype-builtins": "error",
31+
"guard-for-in": "error",
32+
33+
// A dropped `await` in the indexer swallows failures silently.
34+
"@typescript-eslint/no-floating-promises": "error",
35+
"@typescript-eslint/await-thenable": "error",
36+
37+
"no-useless-catch": "error",
38+
"prefer-const": "error",
39+
eqeqeq: ["error", "smart"],
40+
41+
// ── Warnings: pre-existing debt, not worth blocking merges over ────────
42+
//
43+
// Turning these into errors today would mean a typing pass over the
44+
// Stellar SDK call sites in src/routes/jobs.ts. Left visible so the
45+
// count can come down, rather than hidden so it cannot.
46+
"@typescript-eslint/no-unused-vars": [
47+
"warn",
48+
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
49+
],
50+
"@typescript-eslint/no-unsafe-call": "warn",
51+
"@typescript-eslint/no-explicit-any": "warn",
52+
53+
// Handled by the TypeScript program; the base rule misfires on globals.
54+
"no-undef": "off",
55+
},
56+
},
57+
{
58+
files: ["**/*.test.ts", "__tests__/**/*.ts", "jest.setup.ts"],
59+
rules: {
60+
// Tests deliberately poke at loosely-typed mocks.
61+
"@typescript-eslint/no-explicit-any": "off",
62+
"@typescript-eslint/no-unsafe-call": "off",
63+
},
64+
},
65+
);

0 commit comments

Comments
 (0)