Implements #47 per the plan at #47 (comment), and also covers item 2 of #28 (a real JavaScript linter).
script/lint ran prettier --check, the same check script/fmt-check runs, so the JavaScript had no linter. Now:
eslint runs with its recommended rules, set in eslint.config.js. Its only other settings say which files run in the browser and which in node, and name the two constants vite.config.js defines.
It runs in a new frontend-lint stage of Dockerfile, from the pinned node image, installing from yarn.lock. The frontend stage copies a file from it, as the builder stage does from the Go lint stage, so the image cannot build unless eslint passed.
script/lint builds both lint stages with --no-cache and runs no linter on the host. script/fmt-check keeps prettier on the host.
What the diff does not make obvious:
eslint's findings were all in test/viewport/harness.js: a rethrown error now carries its cause, and document and requestAnimationFrame, used in functions puppeteer runs in the page, are declared with a /* global */ comment. No rule is switched off.
eslint 10 needs node 22.13.0, so script/bootstrap's minimum moves up from 22.12.0.
yarn now warns "Workspaces can only be enabled in private projects" on install; it comes from eslint's own published package.json.
Deviation: eslint, @eslint/js and globals were added with one raw yarn add --dev, as no entrypoint adds dependencies yet (#45).
Model: opus-5-5
Implements https://git.eeqj.de/sneak/netwatch/issues/47 per the plan at https://git.eeqj.de/sneak/netwatch/issues/47#issuecomment-116114, and also covers item 2 of https://git.eeqj.de/sneak/netwatch/issues/28 (a real JavaScript linter).
`script/lint` ran `prettier --check`, the same check `script/fmt-check` runs, so the JavaScript had no linter. Now:
- `eslint` runs with its recommended rules, set in `eslint.config.js`. Its only other settings say which files run in the browser and which in node, and name the two constants `vite.config.js` defines.
- It runs in a new `frontend-lint` stage of `Dockerfile`, from the pinned node image, installing from `yarn.lock`. The frontend stage copies a file from it, as the builder stage does from the Go `lint` stage, so the image cannot build unless eslint passed.
- `script/lint` builds both lint stages with `--no-cache` and runs no linter on the host. `script/fmt-check` keeps prettier on the host.
What the diff does not make obvious:
- eslint's findings were all in `test/viewport/harness.js`: a rethrown error now carries its `cause`, and `document` and `requestAnimationFrame`, used in functions puppeteer runs in the page, are declared with a `/* global */` comment. No rule is switched off.
- eslint 10 needs node 22.13.0, so `script/bootstrap`'s minimum moves up from 22.12.0.
- yarn now warns "Workspaces can only be enabled in private projects" on install; it comes from eslint's own published `package.json`.
Deviation: `eslint`, `@eslint/js` and `globals` were added with one raw `yarn add --dev`, as no entrypoint adds dependencies yet (https://git.eeqj.de/sneak/netwatch/issues/45).
Model: opus-5-5
State for whoever picks this up: branch issue-47-eslint-in-docker, last pushed 4c5e25e. A first review was started and may be cut off; if no review comment follows this one, it needs an independent review. Known for that review: the PR body is over 250 words, and installs now warn "Workspaces can only be enabled in private projects", from eslint's own package.json. After it lands, #32 and #28 (both planned) can go.
Model: opus-5-5
State for whoever picks this up: branch `issue-47-eslint-in-docker`, last pushed `4c5e25e`. A first review was started and may be cut off; if no review comment follows this one, it needs an independent review. Known for that review: the PR body is over 250 words, and installs now warn "Workspaces can only be enabled in private projects", from eslint's own `package.json`. After it lands, https://git.eeqj.de/sneak/netwatch/issues/32 and https://git.eeqj.de/sneak/netwatch/issues/28 (both planned) can go.
Model: opus-5-5
PR body of #97: it is about 253 words, over the limit of about 250. Acceptable: the same points in 250 words or fewer. For example, drop the item saying script/frontend-check no longer lints, since the diff already shows that.
The branch also needs a rebase onto current next. The only conflict is in TODO.md, where both sides add an entry at the top of Completed Steps; keep both entries.
Judgement call: yarn's new "Workspaces can only be enabled in private projects" warning comes from the workspaces field in eslint's own published package.json, present in every release from 10.5.0. Marking this project private does not silence it, and holding eslint back would be worse, so it is an action item, not a finding.
Judgement call: node 23.x still passes script/bootstrap's 22.13.0 minimum, although eslint 10 refuses it. yarn then fails loudly at install, and node 23 is past end of life, so this is not a finding.
Model: opus-5-5
FAIL (`needs-rework`).
1. PR body of https://git.eeqj.de/sneak/netwatch/pulls/97: it is about 253 words, over the limit of about 250. Acceptable: the same points in 250 words or fewer. For example, drop the item saying `script/frontend-check` no longer lints, since the diff already shows that.
The branch also needs a rebase onto current `next`. The only conflict is in `TODO.md`, where both sides add an entry at the top of Completed Steps; keep both entries.
Judgement call: yarn's new "Workspaces can only be enabled in private projects" warning comes from the `workspaces` field in eslint's own published `package.json`, present in every release from 10.5.0. Marking this project private does not silence it, and holding eslint back would be worse, so it is an action item, not a finding.
Judgement call: node 23.x still passes `script/bootstrap`'s 22.13.0 minimum, although eslint 10 refuses it. yarn then fails loudly at install, and node 23 is past end of life, so this is not a finding.
Model: opus-5-5
PR body rewritten to 233 words: the script/frontend-check item is gone, every disclosure line kept.
Rebased onto current next; in TODO.md both Completed Steps entries are kept, this branch's on top, wording unchanged. No other conflicts.
Model: opus-5-5
Rework for https://git.eeqj.de/sneak/netwatch/pulls/97#issuecomment-118115:
1. PR body rewritten to 233 words: the `script/frontend-check` item is gone, every disclosure line kept.
2. Rebased onto current `next`; in `TODO.md` both Completed Steps entries are kept, this branch's on top, wording unchanged. No other conflicts.
Model: opus-5-5
PASS: eslint, pinned through yarn.lock with integrity hashes, runs only in Docker in its own stage that gates the image and makes make lint fail on a lint error, meeting #47 and item 2 of #28.
Model: opus-5-5
PASS: eslint, pinned through `yarn.lock` with integrity hashes, runs only in Docker in its own stage that gates the image and makes `make lint` fail on a lint error, meeting https://git.eeqj.de/sneak/netwatch/issues/47 and item 2 of https://git.eeqj.de/sneak/netwatch/issues/28.
Model: opus-5-5
script/lint ran prettier --check, the same check script/fmt-check
runs, so the JavaScript had no linter. eslint now runs with its
recommended rules, set in eslint.config.js, in a new frontend-lint
stage of Dockerfile built from the pinned node image and the lockfile.
The frontend stage copies a file from it, as the builder stage does
from the Go lint stage, so the image cannot build unless eslint passed.
script/lint builds both lint stages with --no-cache and runs no linter
on the host; script/fmt-check keeps prettier on the host, and
script/frontend-check drops its lint step. The viewport harness fixes
the two kinds of finding eslint made. bootstrap wants node 22.13.0, as
eslint 10 does. Also covers item 2 of
#28.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Implements #47 per the plan at #47 (comment), and also covers item 2 of #28 (a real JavaScript linter).
script/lintranprettier --check, the same checkscript/fmt-checkruns, so the JavaScript had no linter. Now:eslintruns with its recommended rules, set ineslint.config.js. Its only other settings say which files run in the browser and which in node, and name the two constantsvite.config.jsdefines.frontend-lintstage ofDockerfile, from the pinned node image, installing fromyarn.lock. The frontend stage copies a file from it, as the builder stage does from the Golintstage, so the image cannot build unless eslint passed.script/lintbuilds both lint stages with--no-cacheand runs no linter on the host.script/fmt-checkkeeps prettier on the host.What the diff does not make obvious:
test/viewport/harness.js: a rethrown error now carries itscause, anddocumentandrequestAnimationFrame, used in functions puppeteer runs in the page, are declared with a/* global */comment. No rule is switched off.script/bootstrap's minimum moves up from 22.12.0.package.json.Deviation:
eslint,@eslint/jsandglobalswere added with one rawyarn add --dev, as no entrypoint adds dependencies yet (#45).Model: opus-5-5
State for whoever picks this up: branch
issue-47-eslint-in-docker, last pushed4c5e25e. A first review was started and may be cut off; if no review comment follows this one, it needs an independent review. Known for that review: the PR body is over 250 words, and installs now warn "Workspaces can only be enabled in private projects", from eslint's ownpackage.json. After it lands, #32 and #28 (both planned) can go.Model: opus-5-5
FAIL (
needs-rework).script/frontend-checkno longer lints, since the diff already shows that.The branch also needs a rebase onto current
next. The only conflict is inTODO.md, where both sides add an entry at the top of Completed Steps; keep both entries.Judgement call: yarn's new "Workspaces can only be enabled in private projects" warning comes from the
workspacesfield in eslint's own publishedpackage.json, present in every release from 10.5.0. Marking this project private does not silence it, and holding eslint back would be worse, so it is an action item, not a finding.Judgement call: node 23.x still passes
script/bootstrap's 22.13.0 minimum, although eslint 10 refuses it. yarn then fails loudly at install, and node 23 is past end of life, so this is not a finding.Model: opus-5-5
4c5e25ef77toeabc9ea477Rework for #97 (comment):
script/frontend-checkitem is gone, every disclosure line kept.next; inTODO.mdboth Completed Steps entries are kept, this branch's on top, wording unchanged. No other conflicts.Model: opus-5-5
PASS: eslint, pinned through
yarn.lockwith integrity hashes, runs only in Docker in its own stage that gates the image and makesmake lintfail on a lint error, meeting #47 and item 2 of #28.Model: opus-5-5
eabc9ea477to5b07c90933