Skip to content

fix(lint): align angular-eslint with its plugins - #6052

Merged
norman-abramovitz merged 5 commits into
cloudfoundry:developfrom
nabramovitz:norm/fix/label-associations
Oct 23, 2026
Merged

norman-abramovitz merged 5 commits into
cloudfoundry:developfrom
nabramovitz:norm/fix/label-associations

Conversation

@nabramovitz

@nabramovitz nabramovitz commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

After the October dependency sweep (#6039), lint reports 22 @angular-eslint/template/label-has-associated-control warnings 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. The angular-eslint meta package, the only one eslint.config.mjs imports, 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 an instanceof check 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 a for attribute pass, because that path has no instanceof check.

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.

Commit Change
fix(lint): align angular-eslint with its plugins angular-eslint 22.5.0 → 22.6.0. Lint goes from 22 warnings to 0, with no template changes.
chore(lint): fail lint on any ESLint warning Adds --max-warnings 0 to the root lint script, the command that both make check lint and make check gate run. The build already fails on warnings; ESLint did not, which is how these 22 went through.
chore(deps): group angular-eslint with its plugins The Dependabot angular group matches "@angular*", which covers the scoped @angular-eslint/* packages but not the unscoped angular-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.
docs(changelog): note the label lint fix changelog.d/0026-label-lint.md
chore(lint): check angular-eslint versions match scripts/lint-nested-pins.mjs also fails when angular-eslint and any root @angular-eslint/* package name different versions, and it now runs first in lint, so a split is reported by name before ESLint prints the false warnings it causes.

Notes

  • scripts/lockdiff.mjs on bun.lock: no new packages. It removes the nested 22.5.0 copies of the angular-eslint packages and the @typescript-eslint 8.70 packages that only those copies used.
  • The angular-eslint 22.6.0 release notes list no change to label-has-associated-control.
  • Before this PR, scripts/lint-nested-pins.mjs did not catch the mismatch: it compared the nested package.json files with the root one, not packages of the same family with each other. The last commit adds that check.

Tests

  • Reverse test of --max-warnings 0: adding one <label> with no control to a template makes bun run lint exit 1 ("ESLint found too many warnings (maximum: 0)").
  • Reverse test of the family check: angular-eslint set back to 22.5.0 makes bun run lint exit 1, with "root package family version split" listing the four @angular-eslint/* packages before ESLint runs.
  • make check gate on all five commits: passed (frontend 4595 passed, 1 skipped; 0 warnings).

AI disclosure (RFC-0047): prepared with AI coding assistance; reviewed by the author.

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.

@norman-abramovitz norman-abramovitz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@norman-abramovitz
norman-abramovitz merged commit 8d4fcf2 into cloudfoundry:develop Oct 23, 2026
24 checks passed
@nabramovitz
nabramovitz deleted the norm/fix/label-associations branch October 24, 2026 13:56
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.

2 participants