Skip to content

build: enable typescript-eslint promise-safety rules #894

Open

Description

@bpowers

Every package's eslint config sets parserOptions.project, so lint already builds full TypeScript type information, but the shared rule set enables no rule that uses it (#892).
Turning on typescript-eslint's promise-safety rules would catch a small number of real bugs that tsc cannot.

Example

populateExamples in src/server/new-user.ts calls files.filter(async (file) => ... stats.isDirectory()).
Every callback returns a Promise, which is truthy, so the filter keeps every entry; non-directories reach populateExample and fail inside a try/catch that only logs.
no-misused-promises flags this (tech-debt entry 44).

A measurement with recommended-type-checked found about 20 findings from no-floating-promises, no-misused-promises, await-thenable, unbound-method, prefer-promise-reject-errors, and no-base-to-string across src/server and src/diagram, and about 470 more from no-unsafe-*, require-await, and no-unnecessary-type-assertion, which are mostly cleanup.
The numbers predate later changes and should be re-measured.

Why it matters

The server is an Express backend and the diagram editor is effect-heavy React; dropped promises and promise-returning callbacks in the wrong place are exactly the failures these rules find.
The type-information cost (about 25-30% of lint time) is already being paid.

Fix

Enable the six promise-safety rules as errors in eslint.config.shared.js, fix each finding (or mark a deliberate fire-and-forget with void and a comment), and fix tech-debt entry 44 in the same change.
Leave the no-unsafe-* and require-await rules off.
Alternative (#892's other option): drop parserOptions.project and take the lint speedup; #893 notes that no-undef then needs attention.

Pointers

Activity

  1. added
    bug
    hygiene
    javascript
    on Jul 8, 2026
  2. changed the title [-]build: enable typescript-eslint promise-safety rules -- ~20 real defects are invisible today[/-] [+]build: enable typescript-eslint promise-safety rules[/+] on Oct 12, 2026
  3. added
    ci
    on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcihygienejavascript

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions