Repository navigation
fix(lint): align angular-eslint with its plugins - #6052
Merged
norman-abramovitz merged 5 commits intoOct 23, 2026
Merged
norman-abramovitz merged 5 commits into
norman-abramovitz merged 5 commits into
Conversation
The October sweep (cloudfoundry#6039) moved @angular-eslint/* to 22.6.0 but left the angular-eslint meta package, the one eslint.config.mjs imports, at 22.5.0. bun then nested a separate template parser and template plugin under the meta package, each with its own bundled Angular compiler. label-has-associated-control finds a control inside a label with an instanceof check, which fails across the two copies, so every label that wraps its control was reported: 22 false warnings in 14 templates. No template was missing a label. lockdiff: no new packages; the nested 22.5.0 family and two stale @typescript-eslint 8.70 copies are removed.
The build already fails on warnings (check-build-warnings.mjs); ESLint did not, which let the 22 label warnings pass the gate unnoticed. Add --max-warnings 0 to the root lint script, the one command both make check lint and make check gate run. Reverse-tested: one unlinked label makes bun run lint exit 1.
The angular group's "@angular*" pattern matches the scoped @angular-eslint/* packages but not the unscoped angular-eslint meta package, so grouped bumps leave it behind. cloudfoundry#6011 moved the four plugins to 22.6.0 without it, and no separate PR for the meta package followed. Add it to the group so all five move together.
lint-nested-pins.mjs now also fails when a root package family names more than one version: angular-eslint and every root @angular-eslint/* package must match. That split caused the 22 false label warnings after cloudfoundry#6039, and nothing reported it as a split. The script now runs first in lint, so the split is reported before ESLint prints the misleading warnings it causes. Reverse-tested: angular-eslint set back to 22.5.0 makes bun run lint exit 1 with the family message first.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
After the October dependency sweep (#6039), lint reports 22
@angular-eslint/template/label-has-associated-controlwarnings in 14 templates. #6039 described them as labels that are not linked to a form control. That is not the cause: every one of those labels wraps its control, which the rule accepts. The warnings are false positives from a version mismatch inside the angular-eslint packages.#6039 took Dependabot's grouped update (#6011), which moved the four
@angular-eslint/*packages to 22.6.0. Theangular-eslintmeta package, the only oneeslint.config.mjsimports, stayed at 22.5.0. With two versions in play, bun installs a second template parser and template plugin under the meta package, each with its own copy of@angular-eslint/bundled-angular-compiler. The rule finds a control inside a label with aninstanceofcheck against that compiler's element class, and the check fails when the parser and the rule use different copies. So every label that wraps its control is reported. Labels with aforattribute pass, because that path has noinstanceofcheck.A two-line template shows it.
<label><input type="checkbox" /> A</label>and<label>B</label>both warn on develop. With this PR only the second one warns, which is the correct result.angular-eslint22.5.0 → 22.6.0. Lint goes from 22 warnings to 0, with no template changes.--max-warnings 0to the rootlintscript, the command that bothmake check lintandmake check gaterun. The build already fails on warnings; ESLint did not, which is how these 22 went through.angulargroup matches"@angular*", which covers the scoped@angular-eslint/*packages but not the unscopedangular-eslint. In August the meta package arrived a day later in its own PR (#5796); in October no such PR came. Adding it to the group makes all five move together.changelog.d/0026-label-lint.mdscripts/lint-nested-pins.mjsalso fails whenangular-eslintand any root@angular-eslint/*package name different versions, and it now runs first inlint, so a split is reported by name before ESLint prints the false warnings it causes.Notes
scripts/lockdiff.mjsonbun.lock: no new packages. It removes the nested 22.5.0 copies of the angular-eslint packages and the@typescript-eslint8.70 packages that only those copies used.label-has-associated-control.scripts/lint-nested-pins.mjsdid not catch the mismatch: it compared the nestedpackage.jsonfiles with the root one, not packages of the same family with each other. The last commit adds that check.Tests
--max-warnings 0: adding one<label>with no control to a template makesbun run lintexit 1 ("ESLint found too many warnings (maximum: 0)").angular-eslintset back to 22.5.0 makesbun run lintexit 1, with "root package family version split" listing the four@angular-eslint/*packages before ESLint runs.make check gateon all five commits: passed (frontend 4595 passed, 1 skipped; 0 warnings).AI disclosure (RFC-0047): prepared with AI coding assistance; reviewed by the author.