Skip to content

fix: parse-error crash, and upgrade to latest VS Code API + Node LTS - #90

Merged
michaellzc merged 3 commits into
masterfrom
chore/upgrade-deps
Jul 20, 2026
Merged

michaellzc merged 3 commits into
masterfrom
chore/upgrade-deps

Conversation

@michaellzc

Copy link
Copy Markdown
Owner

Fixes the "<word> is not a supported rule" crash, then brings the toolchain current.

Three commits, reviewable independently:

  1. fix: the crash + regression tests — closes hadolint: unexpected is not a supported rule #89, closes Weird error: "expecting is not a supported rule" #60
  2. chore: dependency upgrade + CI modernization
  3. style: biome reformat sweep (mechanical)

The bug

hadolint reports Dockerfile parse errors as <file>:<line>:<column> <message>, with no rule code. The rule-violation regex matched those too, taking the column as the line number and the first word of the message as the rule id. getRuleUrl then threw on that bogus id — and it's called inside the diagnostic loop, so one parse error aborted the whole lint run and surfaced as a popup.

Reproduced on hadolint 2.14.0 with a two-line Dockerfile, and verified fixed in the Extension Development Host: diagnostic now reads [hadolint] expecting the workdir path [Ln 2, Col 1] with no popup.

Two more defects found alongside:

  • The level switch had no break statements, so an error-level message raised the error, info and warning popups at once.
  • result !== (undefined || null || "") short-circuits to "" — the undefined/null checks never did anything.

Upgrade

TypeScript 4.5→7.0 · vscode-languageclient/server 8→10 · @types/vscode 1.69→1.125 · Node pinned to 24.18.0 (Krypton LTS) · mocha 8→11 · esbuild/rimraf/glob/which/cross-spawn latest · vsce→@vscode/vsce · vscode-test→@vscode/test-electron · rome (abandoned)→@biomejs/biome.

Vulnerabilities: 18 (1 critical) → 3, all dev-only.

On the #79 revert

#79 was reverted because @vscode/test-electron "broke the integration test (or made it flaky)". Both VS Code builds now sit side by side in .vscode-test/:

vscode-darwin-1.129.1        <- old vscode-test:        .../darwin/stable
vscode-darwin-arm64-1.129.1  <- @vscode/test-electron:  .../darwin-arm64/stable

vscode-test@1.5.2 predates Apple Silicon and pulls the x86_64 build, running VS Code under Rosetta. So the package that was reverted looks like the one that fixes the flakiness — though in Jan 2023 arm64 support was newer and rougher, so that failure was real at the time. Caveat: this is inference from the download URLs on one machine, not a reproduced flake.

Verification

biome check clean · tsc -b clean · 9/9 unit · e2e green 3 runs in a row · vsix packages (9 files, nothing leaked).

Notes for review

  • strict: false is now explicit. TS 7 enables strict by default; this project has never compiled under it. Kept off so this stays an upgrade, not a rewrite — worth its own PR.
  • Output channel is now a LogOutputChannel (languageclient 10 requires it). User-visible: gains log levels/timestamps, and info-level lines may be filtered by default.
  • CI had rotted past the rome reference — ::set-output was disabled by GitHub in 2023 and checkout@v2/setup-node@v2 use removed runtimes, so it could not have been running. Also switched macOS to brew install hadolint, since it was fetching a Darwin-x86_64 binary onto arm64 runners.
  • Removed the Travis CI and Greenkeeper badges — both services are defunct, and vsce@3 refuses to package with SVG badges.
  • e2e still only asserts one diagnostic. Broader e2e coverage would be a good follow-up.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Ndc9cNqeRHHsXDDKuzEmom

michaellzc and others added 3 commits July 19, 2026 21:43
hadolint reports Dockerfile parse errors as

    <file>:<line>:<column> <message>

with no rule code. The rule-violation pattern matched these too, taking
the column as the line number and the first word of the message as the
rule id. getRuleUrl then threw on that bogus id, and since it is called
while building diagnostics, a single parse error aborted the entire lint
run and surfaced as "expecting is not a supported rule".

Match parse errors explicitly, return null from getRuleUrl instead of
throwing, and guard the two nearby crash paths: results may be null for
unparseable output, and hadolint can report a line past the end of the
buffer while the user is still typing.

Also fixes two defects found alongside:
- the level switch had no break statements, so an error-level message
  raised the error, info and warning popups at once
- `result !== (undefined || null || "")` short-circuits to `""`, so the
  undefined and null checks never did anything

Adds unit tests covering both functions; they fail against the previous
implementation.

Closes #89
Closes #60

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ndc9cNqeRHHsXDDKuzEmom
- typescript 4.5 -> 7.0
- vscode-languageclient/server 8 -> 10
- @types/vscode 1.69 -> 1.125, engines.vscode ^1.70 -> ^1.125
- node pinned to 24.18.0 (Krypton LTS), engines.node >=22
- mocha 8 -> 11, @types/mocha 5 -> 10
- esbuild, rimraf, glob, which, cross-spawn to latest
- vsce -> @vscode/vsce, vscode-test -> @vscode/test-electron
- rome (abandoned) -> @biomejs/biome

Vulnerabilities drop from 18 (1 critical) to 3, all dev-only.

API changes this forced:
- vscode-languageclient 10 requires a LogOutputChannel, so the output
  channel is created with {log: true}. It gains log levels and
  timestamps, and info-level lines may be filtered by default.
- glob 9 dropped the callback API, so the test harness uses globSync.
- mocha 11 renamed the useColors option to color.

TypeScript 7 enables `strict` by default. This project has never
compiled under strict, so it is switched off explicitly to keep this an
upgrade rather than a rewrite; enabling it is worth doing separately.

CI had rotted well past the rome reference: ::set-output was disabled by
GitHub in 2023 and checkout@v2/setup-node@v2 use removed runtimes, so
the workflow could not have been running. Modernized, pinned to Node 24,
and macOS now installs hadolint via Homebrew because the workflow was
fetching a Darwin-x86_64 binary onto arm64 runners.

Removes the Travis CI and Greenkeeper badges; both services are defunct
and vsce 3 refuses to package with SVG badges.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ndc9cNqeRHHsXDDKuzEmom
Mechanical reformat of the files not otherwise touched by this branch.
Biome is configured to match the existing rome style (tabs, double
quotes, no bracket spacing) to keep the diff to a minimum.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ndc9cNqeRHHsXDDKuzEmom
@michaellzc
michaellzc merged commit c98d489 into master Jul 20, 2026
3 checks passed
@michaellzc
michaellzc deleted the chore/upgrade-deps branch July 20, 2026 04:49
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.

hadolint: unexpected is not a supported rule Weird error: "expecting is not a supported rule"

1 participant