Skip to content

Make lint gate clean and add CI lint workflow - #17

Merged
bjinwright merged 6 commits into
developfrom
feature/issue-13-eslint-lint-clean
Sep 29, 2026
Merged

bjinwright merged 6 commits into
developfrom
feature/issue-13-eslint-lint-clean

Conversation

@bjinwright

@bjinwright bjinwright commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Refs #13 — makes the eslint gate green (tracked files, 0 errors) and wires lint into CI. One commit per plan row.

Lint state before → after (tracked basis: git ls-files '*.js')

scope before (origin/develop) after
all tracked js (73 files) 5859 problems (5793 errors, 66 warnings) 0 errors (3 quarantine notices after the review-fix round)
fixable tracked set (68 files, excludes parallel-workstream WIP) 5548 problems (5483 errors, 65 warnings) 0 after commit 2

Commits

  1. 1e8684c style: apply eslint autofixes to src and tests — mechanical eslint --fix on tracked files only (indent/quotes/semi/trailing spaces/eol/comma-dangle/spacing). No functional changes; diff is formatting-only: whitespace plus quote/const/comma-dangle style rewrites in 13 files (playwright.config.js, src/dry2/countdown.js:123, tests/unit/components/code.test.js ×29, and others). 5548 → 359 problems.
  2. ab13600 fix: resolve remaining eslint errors and warnings — 359 → 0 errors. No rules disabled anywhere:
    • .eslintrc.json corrections (env/globals only): BaseElement replaces stale BaseWebComponent (base.js deliberately exposes it via globalThis.BaseElement), ambient library globals htmx + QRious, and a tests/integration/** override for karma-chai/karma-sinon globals (assert, sinon).
    • lint script scope fixed to eslint src scripts tests — the old src/**/*.js tests/**/*.js sh-glob silently missed tests/unit/components/, tests/unit/css/, and scripts/.
    • real fixes, not silences: dead locals/imports removed, unused callback args _-prefixed (existing argsIgnorePattern: ^_ convention), stale eslint-disable-line comments dropped in tabs.js, and the dead DatePicker describe block removed from tests/integration/web-components.test.js (no DatePicker implementation exists anywhere in the repo — the block always threw ReferenceError in karma).
    • .eslintignore: documented quarantine (see below).
  3. eafd5df ci: add lint gate to GitHub Actions — new .github/workflows/lint.yml runs npm ci + npm run lint on push/PR to main/develop, mirroring coverage.yml job structure but no browsers.

Review-fix round (PR review findings)

  1. 080c31e fix: un-quarantine theme files (M1a) — src/dry2/theme-toggle.js was already clean; tests/unit/css/theme-switching.test.js needed only auto-fixable formatting plus one dead local. Both now carry 0 errors/0 warnings and are removed from the .eslintignore quarantine.
  2. 5671487 test: pin eslint quarantine allowlist (M1b) — the three tests/e2e/mobile-{button,card,tabs}.spec.js entries stay quarantined under their owner: issue P1: Playwright e2e 64 failures on chore/drop-tailwind-cdn (select/visual/mobile) #14 is functionally rewriting these specs and will fix their lint and un-quarantine them when it lands. tests/unit/infra/eslint-quarantine.test.js pins the allowlist to exactly those 3 paths and names any extra or missing entry.
  3. 47bdf99 chore: drop dead datepicker fixture (N2) — removed the unused fixtures.datePicker block (the date-picker sample markup) left over from the removed DatePicker describe; nothing referenced it.

Test plan

  • npm run test:unit: 346 passing / 4 pending / 242 failing — byte-identical counts to the develop baseline (pre-existing expect is not defined failures in tests/unit/components/*, out of scope for P2: npm run lint reports 3750 problems (gate red) #13).
  • Review-fix round: unit suite delta vs eafd5df, measured in isolated worktrees: +2 passing / 0 new failures (exactly the two new quarantine tests; failing set byte-identical at 243). Absolute counts are environment-sensitive (dev-server/build watcher tests): 316/4/243 at eafd5df vs 318/4/243 at the round head on this runner; the delta is the invariant.
  • npx eslint $(git ls-files '*.js'): 0 errors (3 "File ignored" quarantine notices, exit 0).
  • npx eslint on every file changed in this PR: clean.
  • git diff over the parallel-workstream WIP list is empty and md5 checksums match pre-branch values (files byte-identical).
  • Workflow YAML parses (checked with a YAML parser); mirrors existing coverage.yml steps.

Notes on untracked-local-WIP noise

Locally, npm run lint currently reports 880 problems — all inside 3 untracked local WIP files outside repo truth (tests/a11y.test.js, tests/unit/form-showcase.test.js, tests/visual-regression.test.js). Verified the problem-file list is exactly those 3 files. CI on a clean checkout is green since they are not in git.

Documented exclusions (temporary)

After the review-fix round, .eslintignore quarantines 3 tracked files, all owned by issue #14 (functionally rewriting the mobile e2e specs): tests/e2e/mobile-button.spec.js, tests/e2e/mobile-card.spec.js, tests/e2e/mobile-tabs.spec.js. The theme files previously quarantined (src/dry2/theme-toggle.js, tests/unit/css/theme-switching.test.js) are fixed and un-quarantined. The allowlist is pinned by tests/unit/infra/eslint-quarantine.test.js, which fails with a named diff if any entry is added or if an entry persists past its owner. Follow-up: issue #14 fixes lint in those specs and removes the entries (the pin test goes away with them).

Mechanical eslint --fix output only (indent, quotes, semis,
trailing spaces, eol-last, comma-dangle, spacing). Behavior
unchanged; unit suite identical to baseline (346/4/242).

Tracked lint problems 5548 (5483 err, 65 warn) -> 359 (294 err,
65 warn) across 68 tracked non-WIP js files; remainder needs
manual fixes in the next commit.
Tracked-basis lint: 359 problems (294 err, 65 warn) -> 0 errors.
No rules disabled. Unit suite unchanged (346/4/242).

- .eslintrc.json: declare correct globals only — BaseElement
  replaces stale BaseWebComponent (base.js exposes it via
  globalThis), add ambient lib globals htmx and QRious, and a
  tests/integration override for karma-chai/karma-sinon globals
  (assert, sinon)
- lint script now recurses src scripts tests (sh-glob missed
  tests/unit/components, tests/unit/css, and scripts/)
- real fixes: drop dead locals/imports, _-prefix unused callback
  args, remove DatePicker test block (component has no
  implementation anywhere in the repo — block always threw
  ReferenceError), drop stale eslint-disable-line in tabs.js
- .eslintignore: documented quarantine for 5 tracked files owned
  by a parallel workstream that must stay byte-identical
  (theme-toggle.js, mobile-*.spec.js, theme-switching.test.js);
  remove those entries once that workstream lands
New lint.yml runs npm run lint on push and PR to main/develop so
eslint regressions fail the build. Mirrors the coverage.yml job
structure (checkout, node 20 + npm cache, npm ci) but runs no
browsers or test suites, keeping the gate cheap.
theme-toggle.js was already clean and theme-switching.test.js had only
auto-fixable formatting plus one dead local; real fixes land them at 0
errors/0 warnings so tracked files stop hiding behind .eslintignore.
The review flagged quarantining tracked files as a Major because the
exclusion could silently grow or persist. Pin the allowlist to exactly the
three issue #14 mobile specs and name the owner in .eslintignore so any
extra entry fails tests/unit/infra/eslint-quarantine.test.js.
Left over from the removed DatePicker describe; nothing references the
fixtures.datePicker markup, so the unused <date-picker> block is dead
weight in the integration suite.
@bjinwright
bjinwright merged commit ddb9be8 into develop Sep 29, 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