Skip to content

Apply safe ESLint autofixes and lower the warning baseline - #675

Open
fpigeonjr wants to merge 2 commits into
masterfrom
gh-582-apply-safe-eslint-autofixes-and-lower-the-baseline
Open

Apply safe ESLint autofixes and lower the warning baseline#675
fpigeonjr wants to merge 2 commits into
masterfrom
gh-582-apply-safe-eslint-autofixes-and-lower-the-baseline

Conversation

@fpigeonjr

Copy link
Copy Markdown
Contributor

Description

Applies ESLint's safe automatic fixes to the root workspace and test-app, then lowers the ratcheting warning baseline (eslint-baseline.json) to the new, reduced counts. This establishes a smaller, cleaner lint baseline ahead of the manual semantic-lint cleanup tracked in the parent issue.

Fixes applied (root workspace): prefer-const, @angular-eslint/use-lifecycle-interface, @typescript-eslint/no-wrapper-object-types, @angular-eslint/no-input-rename, no-var.

@angular-eslint/prefer-standalone's autofix was excluded from this pass. It mechanically strips standalone: false from @Component decorators, but every affected component in this codebase is still registered via declarations in an NgModule (not imported as standalone: true). Removing the flag flips Angular's default to standalone: true, which is not a "safe" fix here — it broke TestBed.configureTestingModule for every spec that declares one of these components (827 failing tests when the raw --fix was applied), and is a behavior change, not a style fix. It's left as warning debt for the parent epic (#580) to address deliberately, alongside the actual standalone migration.

test-app's three prefer-standalone warnings on AppComponent/HomeComponent/TabsGalleryComponent are excluded for the same reason (they're declarations in app.module.ts).

Motivation and Context

Closes #582

Type of Change (Select One and Apply Label)

  • Bug fix (non-breaking change which fixes an issue) → Apply bugfix label
  • New feature (non-breaking change which adds functionality) → Apply enhancement label
  • Breaking change (fix or feature that would cause existing functionality to change) → Apply breaking label
  • Documentation / configuration update → Apply maintenance label

How to Test

  1. npm ci && npm ci --prefix test-app
  2. npm run lint → 0 errors, 1307 warnings (root)
  3. npm --prefix test-app run lint → 0 errors, 3 warnings (test-app)
  4. npm --prefix test-app test → 151 test files / 1380 tests pass
  5. npm run coverage:check → passes (coverage unchanged by this PR)
  6. npm run format:check → passes
  7. npm run validate:publish → passes

Expected result: All lint/test/coverage/publish gates pass, and eslint-baseline.json reflects the lowered warning counts (root: 1619 → 1307, test-app: 4 → 3).

Screenshots (if appropriate)

N/A — no UI changes, mechanical lint autofixes only.

Checklist

  • Branch name follows convention (e.g. gh-<number>-<slug>)
  • PR title starts with a verb in the imperative mood
  • I have self-reviewed my own code
  • format:check passes (npm run format:check)
  • lint passes (npm run lint)
  • build passes (cd test-app && npm run build)
  • Tests pass and coverage is reported (cd test-app && npm test)
  • If this change requires a documentation update, I have updated it accordingly
  • If there are dependent changes, they have been merged and published in downstream modules

Runs `ng lint --fix` (via direct ESLint invocation, with
@angular-eslint/prefer-standalone temporarily disabled to avoid a
behavior-changing false-positive fix — see rationale in PR) across
both workspaces and locks the improvement in via
lint:baseline:bump.

- root warnings: 1619 -> 1307
- test-app warnings: 4 -> 3
- 0 lint errors in either workspace
- full test-app suite remains green (1380/1380)
- coverage and publish-validation gates unaffected

Closes #582
@fpigeonjr fpigeonjr added the maintenance Repo maintenance / tooling label Sep 2, 2026
@fpigeonjr fpigeonjr self-assigned this Sep 2, 2026
@fpigeonjr
fpigeonjr requested a lite review from Copilot September 2, 2026 17:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The changes introduce at least one concrete functional/typing regression (data-table OnChanges<T> / dropped generic, listbox screen-reader label typo, and a directive host id binding that won’t update from the input).

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Applies ESLint “safe” autofixes across the raw-source Angular library (root src/) and the test-app workspace, and updates eslint-baseline.json to reflect the reduced warning counts as part of the lint-debt burn-down effort.

Changes:

  • Mechanical ESLint autofixes (e.g., prefer-const, no-var, wrapper type fixes like Stringstring / Objectobject, and lifecycle-interface markers).
  • Minor Angular decorator cleanups (e.g., removing redundant @Input("sameName") aliases).
  • Lowers eslint-baseline.json to the new warning totals.
File summaries
File Description
test-app/src/typings.d.ts Replaces var with let in an ambient declaration per no-var.
src/ui-kit/wrappers/label-wrapper/label-wrapper.component.ts Adds lifecycle interface markers to match existing hooks.
src/ui-kit/wrappers/fieldset-wrapper/fieldset-wrapper.component.ts Adds lifecycle interface markers to match existing hooks.
src/ui-kit/utilities/key-helper/key-helper.ts prefer-const cleanup.
src/ui-kit/utilities/key-helper/key-helper.spec.ts prefer-const cleanup in tests.
src/ui-kit/utilities/are-equal/are-equal.ts prefer-const cleanup.
src/ui-kit/pipes/filesize/filesize.pipe.spec.ts prefer-const cleanup in tests.
src/ui-kit/layout/toolbar/aside-toggle.component.ts Adds lifecycle interface markers to match existing hooks.
src/ui-kit/layout/pagination/pagination.component.ts Adds lifecycle interface markers to match existing hooks.
src/ui-kit/layout/pagination/pagination.component.spec.ts prefer-const cleanup in tests.
src/ui-kit/layout/header/header.component.ts prefer-const cleanup.
src/ui-kit/layout/header/header.component.spec.ts prefer-const cleanup in tests.
src/ui-kit/layout/filter-drawer/dynamic-chips/dynamic-chips.directive.ts prefer-const cleanup.
src/ui-kit/layout-deprecated/page.spec.ts prefer-const cleanup in tests.
src/ui-kit/layout-deprecated/list-results-message.spec.ts prefer-const cleanup in tests.
src/ui-kit/layout-deprecated/grid/row.spec.ts prefer-const cleanup in tests.
src/ui-kit/layout-deprecated/grid/grid.spec.ts prefer-const cleanup in tests.
src/ui-kit/layout-deprecated/grid/column.spec.ts prefer-const cleanup in tests.
src/ui-kit/layout-deprecated/grid/column.directive.ts prefer-const cleanup.
src/ui-kit/form-templates/phone-entry/phone-entry.component.ts Adds lifecycle interface markers to match existing hooks.
src/ui-kit/form-templates/international-phone/sam-international-prefix/international-prefix.component.ts Adds lifecycle interface markers to match existing hooks.
src/ui-kit/form-templates/international-phone/sam-extension/extension.component.ts Adds lifecycle interface markers to match existing hooks.
src/ui-kit/form-service.ts Replaces Subject<Object> with Subject<object>.
src/ui-kit/form-controls/upload-v2/upload-v2.component.ts Adds lifecycle interface markers + prefer-const cleanup.
src/ui-kit/form-controls/toggle-switch/toggle-switch.component.ts prefer-const cleanup.
src/ui-kit/form-controls/textarea/textarea.component.ts Adds lifecycle interface markers + prefer-const cleanup.
src/ui-kit/form-controls/select/select.component.ts Adds lifecycle interface markers to match existing hooks.
src/ui-kit/form-controls/sam-sds-autocomplete/selected-result/selected-result.component.ts Wrapper-type fixes (Objectobject) + prefer-const cleanups.
src/ui-kit/form-controls/sam-sds-autocomplete/selected-result/selected-result.component.spec.ts prefer-const cleanup in tests.
src/ui-kit/form-controls/sam-sds-autocomplete/selected-result/models/sds-selected-item-model-helper.ts prefer-const cleanup.
src/ui-kit/form-controls/sam-sds-autocomplete/autocomplete/autocomplete.component.spec.ts prefer-const cleanup in tests.
src/ui-kit/form-controls/sam-sds-autocomplete/autocomplete-search/autocomplete-search.component.ts Wrapper-type fixes + prefer-const cleanups.
src/ui-kit/form-controls/sam-sds-autocomplete/autocomplete-search/autocomplete-search.component.spec.ts prefer-const cleanup in tests.
src/ui-kit/form-controls/sam-sds-autocomplete/autocomplete-search/autocomplete-seach-test-service.spec.ts prefer-const cleanup + sample data made const.
src/ui-kit/form-controls/radiobutton/radiobutton.component.ts Adds lifecycle interface markers to match existing hooks.
src/ui-kit/form-controls/number/number.component.ts Adds lifecycle interface markers to match existing hooks.
src/ui-kit/form-controls/date/date.component.ts Adds lifecycle interface markers + prefer-const cleanup.
src/ui-kit/form-controls/checkbox/checkbox.component.ts Adds lifecycle interface markers to match existing hooks.
src/ui-kit/form-controls/autocomplete/autocomplete.component.ts Adds lifecycle interface markers + prefer-const cleanups in loops/temps.
src/ui-kit/form-controls/autocomplete-multiselect/autocomplete-multiselect.component.ts Adds lifecycle interface markers + prefer-const cleanups.
src/ui-kit/filters/filters.component.ts Adds lifecycle interface markers to match existing hooks.
src/ui-kit/experimental/video-player/video-player.component.ts Adds lifecycle interface markers to match existing hooks.
src/ui-kit/experimental/title/title.component.ts prefer-const cleanup.
src/ui-kit/experimental/tabs/tab-nav-bar/tab-nav-bar.ts Adds lifecycle interface markers to match existing hooks.
src/ui-kit/experimental/tabs/tab-group.ts Adds lifecycle interface markers + prefer-const cleanup.
src/ui-kit/experimental/tabs/tab-body.ts Removes redundant @Input("sameName") aliases.
src/ui-kit/experimental/sideNavigationToolbar/sideNavigationToolbar/sideNavigationToolbar.component.ts Adds lifecycle interface markers to match existing hooks.
src/ui-kit/experimental/search/search.service.ts prefer-const cleanup.
src/ui-kit/experimental/search/search.component.ts Adds lifecycle interface markers + prefer-const cleanup.
src/ui-kit/experimental/patterns/layout/components/title-section.component.ts Removes redundant @Input("id") alias.
src/ui-kit/experimental/patterns/layout/components/sidenav/sidenav.ts prefer-const cleanup in loops/temps.
src/ui-kit/experimental/patterns/layout/components/page/page.component.ts Adds lifecycle interface markers to match existing hooks.
src/ui-kit/experimental/patterns/layout/components/actionbar.component.ts Adds lifecycle interface markers + import formatting.
src/ui-kit/experimental/listbox/listbox.component.ts Adds lifecycle interface markers + prefer-const cleanup.
src/ui-kit/experimental/layout/layout.component.ts Adds lifecycle interface markers to match existing hooks.
src/ui-kit/experimental/hierarchical/selected-result/selected-result.component.spec.ts prefer-const cleanup in tests.
src/ui-kit/experimental/hierarchical/models/SamHierarchicalTreeHeaderConfiguration.ts Wrapper-type fix (Stringstring).
src/ui-kit/experimental/hierarchical/models/SamHierarchicalTreeConfiguration.ts Wrapper-type fix (Stringstring).
src/ui-kit/experimental/hierarchical/models/SamHierarchicalConfiguration.ts Wrapper-type fix (Stringstring).
src/ui-kit/experimental/hierarchical/hierarchical-tree/hierarchical-tree.component.ts Wrapper-type fixes + prefer-const cleanups.
src/ui-kit/experimental/hierarchical/hierarchical-tree/hierarchical-tree.component.spec.ts prefer-const cleanup in tests.
src/ui-kit/experimental/hierarchical/hierarchical-tree-selectedItem.model.ts prefer-const cleanup.
src/ui-kit/experimental/hierarchical/hierarchical-tree-header/hierarchical-tree-header.component.spec.ts prefer-const cleanup in tests.
src/ui-kit/experimental/hierarchical/hierarchical-tree-grid/hierarchical-tree-grid.component.ts Adds lifecycle interface markers + prefer-const cleanup.
src/ui-kit/experimental/hierarchical/hierarchical-tree-grid/hierarchical-tree-grid.component.spec.ts prefer-const cleanup in tests.
src/ui-kit/experimental/hierarchical/hierarchical-test-service.spec.ts prefer-const cleanup + sample data made const.
src/ui-kit/experimental/hierarchical/autocomplete/autocomplete.component.ts Wrapper-type fixes + prefer-const cleanups.
src/ui-kit/experimental/dollar/dollar.component.ts Adds lifecycle interface markers to match existing hooks.
src/ui-kit/experimental/date-range-v2/datepicker/picker.component.ts Wrapper-type fix (Stringstring).
src/ui-kit/experimental/date-range-v2/datepicker/calendar.spec.ts prefer-const cleanup in tests.
src/ui-kit/experimental/button-next/button.component.ts Wrapper-type fix (Stringstring).
src/ui-kit/experimental/aria/utils/events.ts Wrapper-type fix (Objectobject).
src/ui-kit/experimental/aria/abstract-grid/abstract-grid.ts Wrapper-type fix (Objectobject).
src/ui-kit/experimental/aria/abstract-grid/abstract-cell.ts Wrapper-type fix (Objectobject).
src/ui-kit/experimental/aria/abstract-combobox/abstract-combobox.ts Wrapper-type fixes (Objectobject) in types and methods.
src/ui-kit/experimental/alert/alert.component.ts Adds lifecycle interface markers to match existing hooks.
src/ui-kit/experimental/actions-list/actions-list.component.ts Adds lifecycle interface markers + prefer-const cleanup.
src/ui-kit/elements/button/button.component.ts Wrapper-type fix (Stringstring).
src/ui-kit/directives/sticky/sticky.component.ts Adds lifecycle interface markers to match existing hooks.
src/ui-kit/directives/external-link/external-link.spec.ts prefer-const cleanup in tests.
src/ui-kit/components/tabs/tabs.component.ts Adds lifecycle interface markers to match existing hooks.
src/ui-kit/components/sidenav/sidenav/sidenav.component.ts Adds lifecycle interface markers to match existing hooks.
src/ui-kit/components/sidenav/menu-item/menu-item.spec.ts prefer-const cleanup in tests.
src/ui-kit/components/pagination/pagination.spec.ts prefer-const cleanup in tests.
src/ui-kit/components/pagination/pagination.component.ts no-var / prefer-const cleanups.
src/ui-kit/components/page-title/page-title.component.ts Removes redundant @Input("id") alias.
src/ui-kit/components/modal/modal.component.ts Adds lifecycle interface markers + prefer-const cleanups.
src/ui-kit/components/data-table/sort-header.component.ts Removes redundant @Input("start") alias.
src/ui-kit/components/data-table/data-table.component.ts Adds lifecycle interface marker (but introduces typing issue).
src/ui-kit/components/comments/comments.spec.ts prefer-const cleanup in tests.
src/ui-kit/components/comments/comments.component.ts Adds lifecycle interface marker to match existing hook.
src/ui-kit/components/alert/alert.component.ts Adds lifecycle interface markers to match existing hooks.
src/ui-kit/components/alert-footer/alert-footer.component.ts Adds lifecycle interface markers to match existing hooks.
src/ui-kit/components/actions/actions-dropdown/actions-dropdown.spec.ts prefer-const cleanup in tests.
eslint-baseline.json Lowers the ratcheting warning baseline counts.
Review details
  • Files reviewed: 94/95 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/ui-kit/components/data-table/data-table.component.ts
Comment thread src/ui-kit/experimental/listbox/listbox.component.ts
Comment thread src/ui-kit/experimental/patterns/layout/components/title-section.component.ts Outdated
Copilot review caught three real defects introduced by the safe-fix
pass:

- data-table.component.ts: implements OnChanges<T> is invalid
  (OnChanges is not generic); restore the generic argument on
  _SamTable<T> instead and implement plain OnChanges.
- listbox.component.ts: setHighlightedItem read item["lable"]
  (typo, pre-existing bug the autofix format-touched but didn't
  create) — fixed to item["label"] to match OptionModel.
- title-section.component.ts: removing the @input("id") alias
  exposed that attrId was only ever initialized once from the
  field initializer, so it never tracked later updates to id;
  turned attrId into a getter so the attr.id host binding stays in
  sync with the id input.

All three verified via tsc --noEmit; full test-app suite (1380
tests) still green.
@fpigeonjr
fpigeonjr marked this pull request as ready for review September 2, 2026 19:55
@fpigeonjr
fpigeonjr requested a review from a team as a code owner September 2, 2026 19:55
fpigeonjr added a commit that referenced this pull request Sep 3, 2026
- Rebase branch tip onto latest #675 (gh-582) so this PR's diff/baseline
  reflect only #586's type-safety changes, not #675's still-open autofix
  set. #675 is CLEAN/MERGEABLE and independently reviewed; stacking is the
  documented convention for this repo's slice-based PRs.
- Retarget PR base to gh-582-apply-safe-eslint-autofixes-and-lower-the-baseline
  so the GitHub diff matches (rebase alone doesn't move a PR's base).
- Drop the #674 datepicker outside-click fix and #677 sidenav RxJS fix
  commits from this branch entirely (dropped during rebase) -- both are
  unrelated bugfixes already merged to master via their own PRs; they were
  only present here as inherited ancestry from an earlier base choice, not
  something this PR should carry or take credit for.
- pagination.component.ts: options.value widened to 'string | number' --
  the template already supports numeric option values via attribute
  binding; the prior 'any[]' allowed this and the fix's 'string' literal
  would have narrowed a supported case.
- date-time-display.pipe.ts: transform() parameter widened to include
  'undefined' explicitly -- the implementation's own guard branch handles
  undefined and the pipe previously accepted it; the stricter signature
  would have been a source-compatibility break for existing callers.
- types.ts: HistoryNodeType.queryParams value type widened to include
  readonly arrays and null, matching Angular Router's actual accepted
  queryParams value shapes (repeated params, param removal) instead of
  the narrower 'string | number | boolean' which would reject valid
  existing usage.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Repo maintenance / tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Apply safe ESLint autofixes and lower the baseline

2 participants