Skip to content

The linter has no linter: npm run lint is just tsc, and CI never runs it #15

Description

@royalpinto007

Problem

This project is a linter, and it has no linter.

package.json declares:

"lint": "tsc -p tsconfig.json --noEmit",
"typecheck": "tsc -p tsconfig.json --noEmit",

Two script names, the same command. lint is an alias for typecheck. There is no ESLint config, no ESLint dependency, and CI (.github/workflows/ci.yml) runs npm run typecheck, npm run build, and npm test, so the lint script is not even invoked.

A type checker and a linter answer different questions. tsc will not tell you about an unused import, a floating promise, a catch that swallows an error, or an any that leaked through. This codebase does async work in several places, so the floating-promise class of bug is live rather than theoretical.

Suggested approach

  1. Add ESLint 9 with typescript-eslint, using a flat config (eslint.config.js) since the project is already ESM ("type": "module").
  2. Start from recommended plus recommended-type-checked, and turn on the rules that matter most here: no-floating-promises, await-thenable, no-misused-promises, consistent-type-imports, no-unused-vars.
  3. Make lint actually run ESLint, and keep typecheck as the tsc invocation.
  4. Add a - run: npm run lint step to the CI workflow, on one matrix entry rather than all three.
  5. Fix what it reports. If a rule produces a lot of noise for little value, disable it explicitly in the config with a one line comment explaining why, rather than leaving it on and ignoring the output.
  6. Add a Prettier check too, or state in CONTRIBUTING.md that formatting is not enforced.

Done when

  • npm run lint runs ESLint and the repository is clean.
  • CI fails on a lint error.
  • lint and typecheck are no longer the same command.

Good first issue: setup plus mechanical cleanup. If a lint finding looks like a genuine bug rather than style, open a separate issue for it instead of folding the fix in here.


If you want to take this on, comment on the issue to claim it and it will be assigned. Please keep to a maximum of 2 open claims per person at a time so other contributors get a chance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions