Skip to content

Lint TypeScript sources with typescript-eslint #63

Description

@dalberola

Problem

packages/dredd/eslint.config.mjs is a flat config built only from @eslint/js (js.configs.recommended) plus eslint-config-prettier. It applies no configuration to .ts files, so running the CI lint form (eslint . bin/dredd) silently skips every TypeScript source — invoking eslint on a .ts file directly reports File ignored because no matching configuration was supplied.

This was tolerable when lib/ was almost entirely .js, but the .js.ts conversion (#61) is now moving files out of lint coverage one batch at a time (e.g. the logging cluster in #62, the new lib/validation/ module). Lint coverage shrinks with every conversion.

Proposal

Add typescript-eslint to the flat config so .ts sources are linted:

  • add typescript-eslint dev dependency;
  • extend eslint.config.mjs with tseslint.configs.recommended (or a deliberately scoped subset) applied to **/*.ts;
  • keep eslint-config-prettier last so formatting stays delegated to Prettier;
  • reconcile any findings the new rules surface on the already-converted .ts files (lib/general.ts, lib/sortTransactions.ts, lib/validation/**, the logging cluster).

Acceptance criteria

  • eslint . bin/dredd lints .ts files (verified: introducing a deliberate lint error in a .ts file fails the command).
  • CI quality-checks stays green on main.
  • No Prettier/ESLint rule conflicts (prettier config remains last).

Relates to #61.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions