Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Lint
run: npm run lint

- name: Type check
run: npx tsc --noEmit

Expand Down
2 changes: 1 addition & 1 deletion __tests__/database-writer-pool.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@
},
{
name: "batch-insert-fail",
execute: (db) => {

Check warning on line 257 in __tests__/database-writer-pool.test.ts

View workflow job for this annotation

GitHub Actions / build

'db' is defined but never used. Allowed unused args must match /^_/u

Check warning on line 257 in __tests__/database-writer-pool.test.ts

View workflow job for this annotation

GitHub Actions / build

'db' is defined but never used. Allowed unused args must match /^_/u
throw new Error("Batch operation failed");
},
},
Expand Down Expand Up @@ -340,7 +340,7 @@

describe("Queue management functions", () => {
it("getWriteQueueSize returns correct queue length", async () => {
let queueSizeAtStart = 0;

Check warning on line 343 in __tests__/database-writer-pool.test.ts

View workflow job for this annotation

GitHub Actions / build

'queueSizeAtStart' is assigned a value but never used. Allowed unused vars must match /^_/u

Check warning on line 343 in __tests__/database-writer-pool.test.ts

View workflow job for this annotation

GitHub Actions / build

'queueSizeAtStart' is assigned a value but never used. Allowed unused vars must match /^_/u

const operation: WriteOperation<void> = {
name: "queue-size-check",
Expand Down Expand Up @@ -377,7 +377,7 @@
});

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

const operations = [1, 2, 3].map((num) => ({
name: `operation-${num}`,
Expand Down
134 changes: 0 additions & 134 deletions __tests__/milestone-webhook-events.test.ts

This file was deleted.

18 changes: 3 additions & 15 deletions __tests__/rpc-poller-client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,11 +299,7 @@ describe("RpcPollerClient – database transaction isolation", () => {
return result;
};
const tx = testDb.transaction(wrapped);
try {
return tx();
} catch (e) {
throw e;
}
return tx();
};
Object.assign(wrappedTx, {
default: () => wrappedTx(),
Expand Down Expand Up @@ -337,11 +333,7 @@ describe("RpcPollerClient – database transaction isolation", () => {
return result;
};
const tx = testDb.transaction(wrapped);
try {
return tx();
} catch (e) {
throw e;
}
return tx();
};
Object.assign(wrappedTx, {
default: () => wrappedTx(),
Expand Down Expand Up @@ -381,11 +373,7 @@ describe("RpcPollerClient – database transaction isolation", () => {
return result;
};
const tx = testDb.transaction(wrapped);
try {
return tx();
} catch (e) {
throw e;
}
return tx();
};
Object.assign(wrappedTx, {
default: () => wrappedTx(),
Expand Down
65 changes: 65 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import js from "@eslint/js";
import tseslint from "typescript-eslint";

export default tseslint.config(
{
ignores: [
"dist/**",
"node_modules/**",
"coverage/**",
"eslint.config.mjs",
"jest.config.js",
"verify-ci.js",
],
},
js.configs.recommended,
...tseslint.configs.recommended,
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
Comment on lines +1 to +23
rules: {
// ── Errors: these catch defects tsc does not ───────────────────────────
//
// `in` walks the prototype chain. That is precisely how the milestone
// webhook guard let "toString" through and shipped a payload whose
// newStatus was a function -- code that type-checked perfectly.
"no-prototype-builtins": "error",
"guard-for-in": "error",

// A dropped `await` in the indexer swallows failures silently.
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/await-thenable": "error",

"no-useless-catch": "error",
"prefer-const": "error",
eqeqeq: ["error", "smart"],

// ── Warnings: pre-existing debt, not worth blocking merges over ────────
//
// Turning these into errors today would mean a typing pass over the
// Stellar SDK call sites in src/routes/jobs.ts. Left visible so the
// count can come down, rather than hidden so it cannot.
"@typescript-eslint/no-unused-vars": [
"warn",
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
],
"@typescript-eslint/no-unsafe-call": "warn",
"@typescript-eslint/no-explicit-any": "warn",

// Handled by the TypeScript program; the base rule misfires on globals.
"no-undef": "off",
},
},
{
files: ["**/*.test.ts", "__tests__/**/*.ts", "jest.setup.ts"],
rules: {
// Tests deliberately poke at loosely-typed mocks.
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unsafe-call": "off",
},
},
);
Loading
Loading