Skip to content

add eslint & ci - #100

Merged
dale-wahl merged 10 commits into
masterfrom
lint_ci
Sep 9, 2026
Merged

add eslint & ci#100
dale-wahl merged 10 commits into
masterfrom
lint_ci

Conversation

@dale-wahl

@dale-wahl dale-wahl commented Sep 5, 2026

Copy link
Copy Markdown
Member

Adding automated linting and testing, mainly for the pull requests 4CAT opens automatically. Those carry map_item functions translated from Python by a language model, and nothing looked at them until a person did. Last batch arrived calling five helper functions that the same batch had deleted.

Continuous integration

  • .github/workflows/ci.yml runs npm test and npm run lint on every push and pull request, drafts included
  • The linter runs even when the tests fail, so one run reports both.
  • The item comparer (npm run test:compare) stays out of CI; it needs a reachable 4CAT, an API key and dataset keys. (But we can look at add that next!)

Linting

  • eslint.config.mjs at the repository root, running ESLint's recommended set of 58 rules. no-undef is the one that matters most here to catch those helpers called but never defined.
  • Five style rules are off. The generated map_item bodies trip them, a sync replaces those blocks anyway, and none of them change what the code does.
  • no-prototype-builtins is off too, and that one is not cosmetic: obj.hasOwnProperty(key) throws if a platform's JSON has a key by that name. 31 sites across js/ and modules/, worth its own PR.
  • eslint and @eslint/js are pinned exactly because recommended is a moving list, so upgrading should be a decision rather than a side effect.
  • tests/ and popup/ are excluded, with the reasons in the comments.

Housekeeping

  • tests/Dockerfile.test deleted; I was using it but it stopped working and isn't needed
  • engines added to tests/package.json: ESLint puts the Node floor at 20.19 so this made sense.
  • eslint.config.mjs excluded from the release zip scripts
  • One code change outside the tooling: a self-assignment removed from modules/gab.js (hand-written capture code, not a generated block), so no-self-assign can stay on.

@dale-wahl
dale-wahl marked this pull request as ready for review September 9, 2026 13:41
@dale-wahl
dale-wahl merged commit 450f541 into master Sep 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant