|
| 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