build: add ESLint to script/lint and containerize linting (closes #152)
This commit was merged in pull request #286.
This commit is contained in:
17
README.md
17
README.md
@@ -89,7 +89,13 @@ provide:
|
||||
- `script/test-e2e-firefox` — run the Firefox browser end-to-end suite (same,
|
||||
against an image with a pinned Firefox and geckodriver, see
|
||||
[End-to-End Tests](#end-to-end-tests))
|
||||
- `script/lint` — run the linter
|
||||
- `script/lint` — run ESLint (`eslint.config.js`) and then `prettier --check`,
|
||||
failing on either. It never writes: `--fix` is not in this path, so
|
||||
`make check` stays non-mutating. Linting runs in the container — the script
|
||||
builds the Dockerfile's `lint` stage — because an ESLint result that depends
|
||||
on whichever ESLint the host happens to have is not a result. Docker is
|
||||
therefore required to lint; inside that image `AUTISTMASK_LINT_NATIVE=1` makes
|
||||
the same script lint in place instead of recursing.
|
||||
- `script/fmt` — format all files (writes)
|
||||
- `script/fmt-check` — check formatting (read-only)
|
||||
- `script/check` — run test, test-verify-build, lint, and fmt-check
|
||||
@@ -234,9 +240,12 @@ being intercepted, run with `E2E_TRACE_NETWORK=1` and every routed request is
|
||||
printed, tagged `[sw]` or `[page]`.
|
||||
|
||||
**Any uncaught page error or `console.error` fails the run.** That is the point:
|
||||
a `ReferenceError` from a used-but-not-imported identifier is invisible to
|
||||
`make check` (`script/lint` is only `prettier --check`) but fatal in a browser,
|
||||
and this suite exists because exactly that class of bug shipped twice.
|
||||
this suite exists because a `ReferenceError` from a used-but-not-imported
|
||||
identifier shipped twice, fatal in a browser and invisible to a `make check`
|
||||
that was `prettier --check` only. ESLint's `no-undef` now catches that exact
|
||||
class before a browser is involved, so this suite is no longer the only thing
|
||||
standing between it and a release — but a static rule only sees identifiers, and
|
||||
the runtime errors this suite catches are broader than one rule.
|
||||
|
||||
### Firefox (`make test-e2e-firefox`)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user