Skip to content

Remove unused declarations and const-related lint debt - #686

Merged
fpigeonjr merged 28 commits into
masterfrom
gh-585-remove-unused-declarations-and-const-related-lint-debt
Sep 10, 2026
Merged

Remove unused declarations and const-related lint debt#686
fpigeonjr merged 28 commits into
masterfrom
gh-585-remove-unused-declarations-and-const-related-lint-debt

Conversation

@fpigeonjr

Copy link
Copy Markdown
Contributor

Description

Removes the @typescript-eslint/no-unused-vars and prefer-const lint debt across the library (root workspace), then promotes both rules from warn to error and lowers the warning baseline to reflect the cleanup.

Scope of the cleanup (161 files):

  • Removed unused imports, local variables, and function/lifecycle parameters. Where a parameter is required by a framework signature (e.g. @HostListener, ControlValueAccessor.registerOnChange) but genuinely unused, it was dropped from the signature entirely rather than underscore-prefixed — this project's ESLint config has no argsIgnorePattern/varsIgnorePattern, so a leading underscore does not suppress the warning here (verified via a scratch reproduction before starting the batch work).
  • Converted never-reassigned let/var declarations to const (including a few stray var loop counters converted to let/const pairs).
  • Fixed a handful of components where a prior autofix pass had accidentally blanked the standalone: false line while removing an unused import from the same @Component/@Directive decorator block — these were caught by full-suite test failures (TestBed.configureTestingModule rejecting a standalone component in a declarations array) and restored.
  • Ran Prettier over every file touched, to keep the diff consistent with the repo's formatting baseline.

Config changes:

  • eslint.config.mjs: promoted prefer-const and @typescript-eslint/no-unused-vars from warn to error, since both rules now have zero occurrences across the codebase.
  • eslint-baseline.json: root warning ceiling lowered from 1619 to 1031 via npm run lint:baseline:bump, reflecting the ~590 warnings removed by this cleanup. test-app's baseline (4) is untouched — none of its warnings come from the two target rules.

No behavior changes are intended; this is a pure dead-code/const-conversion refactor over existing, tested code. No new specs were added — the existing spec suite (and full test-app suite) serves as the regression oracle.

Motivation and Context

Closes #585

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 format:check — expect pass
  3. npm run lint — expect 0 errors, 1031 warnings (at/below the lowered baseline)
  4. npm run lint:baseline — expect ✓ root: 1031 warnings (baseline 1031), 0 errors. Lint baseline gate passed.
  5. cd test-app && npm run lint — expect 0 errors, 4 pre-existing warnings (unaffected, unrelated rules)
  6. cd test-app && npm test — expect all specs green (152 files / 1386 tests)
  7. cd test-app && npm run build — expect a clean Angular build
  8. npm run validate:publish — expect all packed files, tracked src/ui-kit files, and consumer deep imports verified intact

Expected result: All commands above exit 0. no-unused-vars and prefer-const report zero warnings anywhere in the root workspace; both rules are now error-level in eslint.config.mjs, so any regression will fail npm run lint immediately rather than silently inflating the warning count.

Screenshots (if appropriate)

N/A — backend/logic and lint-config changes only, no visual changes.

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

Removes unused imports/vars flagged by @typescript-eslint/no-unused-vars
and converts never-reassigned let to const (prefer-const) in:
- src/ui-kit/elements/button/button.spec.ts
- src/ui-kit/pipes/filesize/filesize.pipe.spec.ts
- src/formly/components/autocomplete/autocomplete.component.ts
- src/ui-kit/wrappers/fieldset-wrapper/*
- src/ui-kit/wrappers/label-wrapper/*

Part of #585.
- are-equal.ts: destructured multi-var let -> const
- key-helper.ts: prefer-const for lowercased
- key-helper.spec.ts: remove unused 'instance' declaration, convert
  never-reassigned test helper lets to const

Part of #585.
- click-outside, focus, tab-outside, sticky specs: drop unused
  waitForAsync/fakeAsync/tick imports and the never-read 'directive'
  local (query it directly per-test instead where actually used)
- external-link.spec.ts: drop unused imports, convert let->const
- drag-drop.directive.ts: drop unused HostListener event param
- sticky.component.ts: drop unused resize/scroll event params

Part of #585.
Drops unused waitForAsync/Component/By imports and unused 'component'
locals across form-only-page, grid directives+specs, list-results-message,
page/page.service, pages/form-step, results, sidebar, title-and-section,
and workspace-template specs. Converts never-reassigned let->const in
column.directive.ts and the grid *.spec.ts row/col/grid class-value tests.

Part of #585.
All never-reassigned let declarations in the HierarchicalDataService
test fixture converted to const.

Part of #585.
- Removes unused event/ev handler params, converts them to () when
  truly unused, or renames to _val for CVA setter params that must
  keep an arg for the type signature
- Converts never-reassigned let->const throughout getObjectValue,
  updateDelimeterModel, selectItem, getFlatElements,
  scrollToSelectedItem, showFreeText, createFreeTextItem, onScroll
- Propagates the same propogateChange no-op-arg fix to sibling
  CVA implementations that shared the identical unused-param pattern
  (hierarchical/hierarchical, hierarchical/autocomplete,
  hierarchical/selected-result, sam-sds-autocomplete/selected-result,
  form-controls/autocomplete)

Part of #585.
- Drop unused rxjs 'of' import (only used in a doc comment example)
- Prefix unused requestError/checkForFocus event params with _
- Remove dead 'categories'/'index'/'arr' locals in filterKeyValuePairs
- Convert never-reassigned let->const throughout onDownArrowDown,
  setMessage, onUpArrowDown, listItemHover, onEnterDown, onScroll,
  freeTextAvalible

Part of #585.
…grid, autocomplete-multiselect specs/component

Part of #585.
… autocomplete, date-range-v2 calendar spec, date component

Part of #585.
…icon.component, selected-result spec

Part of #585.
…al-tree, title component, sam-sds-autocomplete spec

Part of #585.
…tton, sam-sds-autocomplete, time, toggle-switch, name-entry, header spec

Part of #585.
…alert-footer, breadcrumbs, comments.service, image, modal, point-of-contact

Part of #585.
…hierarchical-tree-grid, sideNavigationToolbar, tab-header, sam-form-control, textarea, international-phone, name-entry, filters-wrapper

Part of #585.
…grid, events, hierarchical-tree spec, listbox, actionbar, sidenav, autocomplete-multiselect

Part of #585.
…ct, textarea, time, toggle-switch, upload-v2, phone-entry, footer

Part of #585.
…age-title, pagination, sidenav.service, spinner, tabs, banner, alert specs

Part of #585.
…ls, form-templates, layout)

Zero occurrences remain for @typescript-eslint/no-unused-vars and prefer-const.
Part of #585.
Both rules now have zero occurrences across the codebase; per
#585 they graduate from warn to error to prevent
regression.

Part of #585.
Reflects the ~590 warnings removed while burning down no-unused-vars
and prefer-const debt (#585). Generated via
npm run lint:baseline:bump.
@fpigeonjr fpigeonjr added the maintenance Repo maintenance / tooling label Sep 3, 2026
@fpigeonjr fpigeonjr self-assigned this Sep 3, 2026
@fpigeonjr
fpigeonjr requested a balanced review from Copilot September 3, 2026 18:04

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

Required handler and service parameters were removed despite remaining typed, template, and contract call sites.

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

Pull request overview

Removes unused declarations, applies const where possible, and strengthens root-workspace lint enforcement.

Changes:

  • Removes unused imports, variables, and parameters.
  • Converts stable declarations to const.
  • Promotes no-unused-vars and prefer-const to errors and lowers the warning baseline.
  • Introduces several blocking method-arity mismatches at existing call sites.
File summaries
File Description
src/ui-kit/wrappers/label-wrapper/label-wrapper.spec.ts Cleans unused test imports.
src/ui-kit/wrappers/label-wrapper/label-wrapper.component.ts Cleans callback parameters.
src/ui-kit/wrappers/fieldset-wrapper/fieldset-wrapper.spec.ts Cleans unused test imports.
src/ui-kit/wrappers/fieldset-wrapper/fieldset-wrapper.component.ts Removes an unused resize parameter.
src/ui-kit/utilities/key-helper/key-helper.ts Converts a binding to const.
src/ui-kit/utilities/key-helper/key-helper.spec.ts Cleans test declarations.
src/ui-kit/utilities/are-equal/are-equal.ts Converts a binding to const.
src/ui-kit/pipes/filesize/filesize.pipe.spec.ts Makes the pipe binding constant.
src/ui-kit/layout/toolbar/toolbar.spec.ts Removes unused fixture state.
src/ui-kit/layout/pagination/pagination.component.spec.ts Cleans imports and declarations.
src/ui-kit/layout/page/pagination.component.spec.ts Removes an unused router import.
src/ui-kit/layout/header/header.component.ts Makes a selected item constant.
src/ui-kit/layout/header/header.component.spec.ts Cleans imports and constants.
src/ui-kit/layout/footer/footer.component.spec.ts Removes unused testing utilities.
src/ui-kit/layout/filters-wrapper/filters-wrapper.component.ts Removes unused RxJS values.
src/ui-kit/layout/filter-drawer/filter-drawer.component.ts Removes an unused service import.
src/ui-kit/layout/filter-drawer/dynamic-chips/dynamic-chips.directive.ts Makes a component reference constant.
src/ui-kit/layout-deprecated/workspace/workspace-template.spec.ts Removes unused test state.
src/ui-kit/layout-deprecated/title-and-section.spec.ts Removes unused test state.
src/ui-kit/layout-deprecated/sidebar.spec.ts Removes unused test state.
src/ui-kit/layout-deprecated/results.spec.ts Removes unused test state.
src/ui-kit/layout-deprecated/pages/form-step.spec.ts Removes unused test imports.
src/ui-kit/layout-deprecated/page.spec.ts Removes unused declarations.
src/ui-kit/layout-deprecated/page.service.spec.ts Removes unused imports.
src/ui-kit/layout-deprecated/list-results-message.spec.ts Cleans imports and constants.
src/ui-kit/layout-deprecated/grid/row.spec.ts Cleans test declarations.
src/ui-kit/layout-deprecated/grid/row.directive.ts Removes an unused Angular import.
src/ui-kit/layout-deprecated/grid/grid.spec.ts Cleans test declarations.
src/ui-kit/layout-deprecated/grid/grid.directive.ts Removes an unused Angular import.
src/ui-kit/layout-deprecated/grid/column.spec.ts Cleans test declarations.
src/ui-kit/layout-deprecated/grid/column.directive.ts Makes a lookup constant.
src/ui-kit/layout-deprecated/form-only-page.spec.ts Removes unused test state.
src/ui-kit/form-templates/phone-entry/phone-entry.component.ts Removes unused forms imports.
src/ui-kit/form-templates/name-entry/name-entry.spec.ts Cleans imports and callbacks.
src/ui-kit/form-templates/name-entry/name-entry.component.ts Removes a validator parameter still required by its contract and tests.
src/ui-kit/form-templates/international-phone/sam-telephone/telephone.spec.ts Removes an unused test value.
src/ui-kit/form-templates/international-phone/sam-extension/extension.spec.ts Removes an unused mock event.
src/ui-kit/form-templates/international-phone/sam-extension/extension.component.ts Removes unused imports.
src/ui-kit/form-templates/international-phone/international.spec.ts Removes unused catch bindings.
src/ui-kit/form-templates/international-phone/international.component.ts Removes an unused subscription value.
src/ui-kit/form-controls/upload/upload.component.ts Removes an unused catch binding.
src/ui-kit/form-controls/upload-v2/upload-v2.component.ts Cleans catch and constant bindings.
src/ui-kit/form-controls/toggle-switch/toggle-switch.spec.ts Cleans imports and callbacks.
src/ui-kit/form-controls/toggle-switch/toggle-switch.component.ts Cleans imports and declarations.
src/ui-kit/form-controls/time/time.spec.ts Cleans catch and callback bindings.
src/ui-kit/form-controls/time/time.component.ts Removes unused imports.
src/ui-kit/form-controls/textarea/textarea.spec.ts Cleans imports and callbacks.
src/ui-kit/form-controls/textarea/textarea.component.ts Cleans callbacks and constants.
src/ui-kit/form-controls/text/text.spec.ts Removes an unused callback argument.
src/ui-kit/form-controls/text/text.component.ts Simplifies a default callback.
src/ui-kit/form-controls/select/select.spec.ts Cleans callback and catch bindings.
src/ui-kit/form-controls/select/select.component.ts Removes an unused no-op.
src/ui-kit/form-controls/sam-sds-autocomplete/selected-result/selected-result.component.ts Cleans callbacks and constants.
src/ui-kit/form-controls/sam-sds-autocomplete/selected-result/selected-result.component.spec.ts Converts test bindings to constants.
src/ui-kit/form-controls/sam-sds-autocomplete/selected-result/models/sds-selected-item-model-helper.ts Makes a lookup constant.
src/ui-kit/form-controls/sam-sds-autocomplete/autocomplete/autocomplete.component.ts Removes a parameter still passed by template bindings.
src/ui-kit/form-controls/sam-sds-autocomplete/autocomplete/autocomplete.component.spec.ts Cleans imports and constants.
src/ui-kit/form-controls/sam-sds-autocomplete/autocomplete-search/autocomplete-search.component.ts Removes handler parameters still required by templates and tests.
src/ui-kit/form-controls/sam-sds-autocomplete/autocomplete-search/autocomplete-search.component.spec.ts Removes unused values and uses constants.
src/ui-kit/form-controls/sam-sds-autocomplete/autocomplete-search/autocomplete-seach-test-service.spec.ts Converts service bindings to constants.
src/ui-kit/form-controls/sam-form-control/sam-form-control.ts Removes unused observer parameters.
src/ui-kit/form-controls/radiobutton/radiobutton.spec.ts Removes an unused catch binding.
src/ui-kit/form-controls/radiobutton/radiobutton.component.ts Removes unused forms dependencies.
src/ui-kit/form-controls/number/number.spec.ts Cleans a callback argument.
src/ui-kit/form-controls/date/date.spec.ts Removes an unused catch binding.
src/ui-kit/form-controls/date/date.component.ts Removes handler parameters still required by templates and tests.
src/ui-kit/form-controls/date-time/date-time.component.ts Removes unused output imports.
src/ui-kit/form-controls/date-range/date-range.spec.ts Cleans a callback argument.
src/ui-kit/form-controls/date-range/date-range.component.ts Removes an unused validation object.
src/ui-kit/form-controls/checkbox/index.ts Removes an unused type import.
src/ui-kit/form-controls/checkbox/checkbox.component.ts Simplifies a default callback.
src/ui-kit/form-controls/autocomplete/autocomplete.spec.ts Cleans a callback argument.
src/ui-kit/form-controls/autocomplete/autocomplete.service.ts Narrows signatures still used by three-argument callers.
src/ui-kit/form-controls/autocomplete/autocomplete.component.ts Removes callback parameters still passed by production callers.
src/ui-kit/form-controls/autocomplete-multiselect/autocomplete-multiselect.spec.ts Cleans a callback argument.
src/ui-kit/form-controls/autocomplete-multiselect/autocomplete-multiselect.component.ts Removes a handler parameter still passed by template bindings.
src/ui-kit/experimental/video-player/video-player.component.ts Removes an event parameter still required by metadata and tests.
src/ui-kit/experimental/title/title.component.ts Cleans imports and declarations.
src/ui-kit/experimental/tabs/tab-header.ts Cleans imports and position bindings.
src/ui-kit/experimental/tabs/tab-group.ts Makes the selected index constant.
src/ui-kit/experimental/sideNavigationToolbar/sideNavigationToolbar/sideNavigationToolbar.component.ts Removes unused Angular imports.
src/ui-kit/experimental/segment/segment.component.ts Removes an unused input import.
src/ui-kit/experimental/search/search.service.ts Converts search bindings to constants.
src/ui-kit/experimental/search/search.component.ts Cleans imports and constants.
src/ui-kit/experimental/picker/popover.ts Removes an unused view import.
src/ui-kit/experimental/picker/picker.ts Removes a callback parameter still passed by its caller.
src/ui-kit/experimental/patterns/layout/components/sidenav/sidenav.ts Converts stable declarations to constants.
src/ui-kit/experimental/patterns/layout/components/main.component.ts Removes an unused event value.
src/ui-kit/experimental/patterns/layout/components/actionbar.component.ts Removes callback parameters still passed by subscriptions.
src/ui-kit/experimental/patterns/layout/architecture/update/reducer.ts Removes an unused store import.
src/ui-kit/experimental/listbox/listbox.component.ts Cleans callbacks and constants.
src/ui-kit/experimental/input-mask/input-mask.spec.ts Removes unused test setup.
src/ui-kit/experimental/input-mask/input-mask.component.ts Removes an unused interface import.
src/ui-kit/experimental/icon/icon.component.ts Removes unused icon types.
src/ui-kit/experimental/hierarchical/selected-result/selected-result.component.ts Cleans imports and callbacks.
src/ui-kit/experimental/hierarchical/selected-result/selected-result.component.spec.ts Makes a test item constant.
src/ui-kit/experimental/hierarchical/hierarchical/hierarchical.component.ts Cleans imports and callbacks.
src/ui-kit/experimental/hierarchical/hierarchical-tree/hierarchical-tree.component.ts Cleans types, subscriptions, and constants.
src/ui-kit/experimental/hierarchical/hierarchical-tree/hierarchical-tree.component.spec.ts Cleans imports and constants.
src/ui-kit/experimental/hierarchical/hierarchical-tree-selectedItem.model.ts Makes an item lookup constant.
src/ui-kit/experimental/hierarchical/hierarchical-tree-header/hierarchical-tree-header.component.ts Removes an event parameter still required by template and test callers.
src/ui-kit/experimental/hierarchical/hierarchical-tree-header/hierarchical-tree-header.component.spec.ts Makes configuration constant.
src/ui-kit/experimental/hierarchical/hierarchical-tree-grid/hierarchical-tree-grid.component.ts Makes scroll metrics constant.
src/ui-kit/experimental/hierarchical/hierarchical-tree-grid/hierarchical-tree-grid.component.spec.ts Cleans imports and constants.
src/ui-kit/experimental/hierarchical/hierarchical-test-service.spec.ts Converts service bindings to constants.
src/ui-kit/experimental/hierarchical/autocomplete/autocomplete.component.ts Removes an event parameter still passed by template bindings.
src/ui-kit/experimental/date-range-v2/datepicker/calendar.spec.ts Cleans imports and constants.
src/ui-kit/experimental/date-range-v2/date-range-v2.component.ts Removes unused outputs and callback arguments.
src/ui-kit/experimental/date-range-v2/date-range-v2.component.spec.ts Removes unused test imports.
src/ui-kit/experimental/aria/utils/events.ts Removes unused tuple values.
src/ui-kit/experimental/aria/abstract-grid/abstract-grid.ts Removes unused callback values.
src/ui-kit/experimental/aria/abstract-combobox/abstract-combobox.ts Cleans imports and event values.
src/ui-kit/experimental/alert/alert.component.ts Removes unused output imports.
src/ui-kit/experimental/actions-list/actions-list.component.ts Converts declarations to constants.
src/ui-kit/elements/button/button.spec.ts Removes an unused async helper.
src/ui-kit/directives/tab-outside/taboutside.spec.ts Removes unused testing helpers.
src/ui-kit/directives/sticky/sticky.spec.ts Removes unused test state.
src/ui-kit/directives/sticky/sticky.component.ts Removes handler parameters still passed by existing specs.
src/ui-kit/directives/focus/focus.spec.ts Removes unused directive setup.
src/ui-kit/directives/external-link/external-link.spec.ts Cleans imports, state, and constants.
src/ui-kit/directives/drag-drop/drag-drop.directive.ts Narrows a public handler still called with drag events.
src/ui-kit/directives/click-outside/click-outside.spec.ts Removes unused directive setup.
src/ui-kit/components/tabs/tabs.spec.ts Removes an unused query import.
src/ui-kit/components/spinner/spinner.spec.ts Removes unused fixture state.
src/ui-kit/components/sidenav/sidenav/sidenav.spec.ts Removes unused test imports.
src/ui-kit/components/sidenav/services/sidenav.service.ts Removes an unused Observable import.
src/ui-kit/components/sidenav/menu-item/menu-item.spec.ts Cleans imports, state, and constants.
src/ui-kit/components/point-of-contact/point-of-contact.spec.ts Removes unused testing helpers.
src/ui-kit/components/pagination/pagination.spec.ts Cleans helpers and constants.
src/ui-kit/components/pagination/pagination.component.ts Modernizes declarations.
src/ui-kit/components/page-title/page-title.component.ts Removes an unused host-binding import.
src/ui-kit/components/multiselect-dropdown/multiselect-dropdown.spec.ts Removes an unused module import.
src/ui-kit/components/modal/modal.component.ts Makes focus references constant.
src/ui-kit/components/image/image.component.ts Removes unused stream values.
src/ui-kit/components/history/history.spec.ts Removes an unused async helper.
src/ui-kit/components/header/header.component.spec.ts Removes unused component state.
src/ui-kit/components/header-next/header.component.ts Removes a resize event parameter.
src/ui-kit/components/footer-next/footer-nav-item.component.ts Removes an unused host import.
src/ui-kit/components/download/download.spec.ts Removes an unused debug type.
src/ui-kit/components/data-table/data-table.component.ts Removes unused imports and stub code.
src/ui-kit/components/data-table/data-source.sample.spec.ts Removes an unused RxJS import.
src/ui-kit/components/comments/comments.spec.ts Cleans imports, state, and declarations.
src/ui-kit/components/comments/comments.service.ts Narrows service methods still called with comment payloads.
src/ui-kit/components/comments/comments.module.ts Removes an unused service import.
src/ui-kit/components/comments/comments.component.ts Cleans imports and stream parameters.
src/ui-kit/components/comments/comment/comment.spec.ts Removes an unused module import.
src/ui-kit/components/comments/comment/comment.component.ts Removes an unused click parameter.
src/ui-kit/components/breadcrumbs/breadcrumbs.spec.ts Removes unused router and RxJS imports.
src/ui-kit/components/breadcrumbs/breadcrumbs.component.ts Removes unused router imports.
src/ui-kit/components/banner/banner.spec.ts Removes an unused query import.
src/ui-kit/components/alert/alert.spec.ts Removes an unused changes type.
src/ui-kit/components/alert-footer/alert-footer.spec.ts Removes unused imports and state.
src/ui-kit/components/alert-footer/alert-footer.service.ts Removes an unused component import.
src/ui-kit/components/actions/actions-dropdown/actions-dropdown.spec.ts Makes event fixtures constant.
src/ui-kit/components/actions/actions-dropdown/actions-dropdown.component.ts Removes a handler parameter still passed by template bindings.
src/ui-kit/components/actions/action-button/action-button.component.ts Removes an unused lifecycle import.
src/ui-kit/components/accordion/accordion.spec.ts Removes unused test declarations.
src/formly/components/autocomplete/test.service.ts Removes an unused fetch parameter.
src/formly/components/autocomplete/autocomplete.component.ts Removes an unused service import.
eslint.config.mjs Promotes both cleaned lint rules to errors.
eslint-baseline.json Lowers the root warning ceiling.
Review details

Suppressed comments (8)

src/ui-kit/components/comments/comments.service.ts:30

  • The component still passes the new comment to postComment and the selected comment to deleteComment (comments.component.ts:113,134). Removing both parameters causes TS2554 and prevents implementations of this exported service from receiving those payloads; keep the contract while explicitly consuming values in the no-op default.
  postComment(): Observable<Comment[]> {
    return of(this._comments);
  }

  deleteComment(): Observable<Comment[]> {

src/ui-kit/directives/sticky/sticky.component.ts:48

  • The existing spec calls scroll(undefined), which no longer matches this zero-argument public signature. Keep and explicitly consume the event parameter so the test and downstream typed calls remain valid.
    src/ui-kit/experimental/patterns/layout/components/actionbar.component.ts:49
  • The subscription at line 34 still calls _onUnitsChange(evt), so removing this parameter makes the production source fail type checking with TS2554. Preserve the callback signature and explicitly consume the unused value.
    src/ui-kit/form-controls/autocomplete/autocomplete.component.ts:781
  • The component template and three existing specs still call checkForFocus with an event. Narrowing this public handler to zero arguments creates template/direct-call arity errors; preserve and explicitly consume the parameter.
    src/ui-kit/form-controls/date/date.component.ts:380
  • The template and existing specs still pass an event to onDayBlur. Retain and explicitly consume the parameter so the component continues to type-check.
    src/ui-kit/form-controls/date/date.component.ts:458
  • The template and several existing specs still invoke onYearBlur with an argument. This narrowed signature causes an arity error; retain and explicitly consume the event.
    src/ui-kit/form-controls/sam-sds-autocomplete/autocomplete-search/autocomplete-search.component.ts:229
  • The template and existing spec still invoke clickOutSide($event). Keep and explicitly consume the event parameter to prevent an arity mismatch.
    src/ui-kit/form-controls/sam-sds-autocomplete/autocomplete-search/autocomplete-search.component.ts:289
  • The keypress binding and existing specs pass an event to this public method. The zero-argument signature breaks those typed invocations; retain and explicitly consume the parameter.
  • Files reviewed: 161/161 changed files
  • Comments generated: 17
  • Review effort level: Balanced

💡 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/actions/actions-dropdown/actions-dropdown.component.ts Outdated
Comment thread src/ui-kit/components/comments/comments.service.ts Outdated
Comment thread src/ui-kit/directives/drag-drop/drag-drop.directive.ts Outdated
Comment thread src/ui-kit/directives/sticky/sticky.component.ts Outdated
Comment thread src/ui-kit/experimental/hierarchical/autocomplete/autocomplete.component.ts Outdated
Comment thread src/ui-kit/form-controls/date/date.component.ts Outdated
Comment thread src/ui-kit/form-controls/date/date.component.ts Outdated
Comment thread src/ui-kit/form-templates/name-entry/name-entry.component.ts Outdated
Address Copilot review feedback on PR #686: several handlers/service
methods had their parameters removed entirely, but those parameters
are still required by:
- Angular templates that bind an argument (e.g. `(clickOutside)="hideActions($event)"`)
- Existing spec call sites passing explicit arguments
- Exported service/validator contracts (Angular's `Validator` interface,
  `ControlValueAccessor`) that downstream consumers may implement or call

Restored each parameter (kept optional where the call was previously
zero-arg-callable) and explicitly consumed it with a `void param;`
statement so the parameter satisfies both the caller's arity and
@typescript-eslint/no-unused-vars (which has no argsIgnorePattern in
this repo's config, so a leading underscore alone does not suppress
the rule).

Affected: actions-dropdown, comments.service, drag-drop.directive,
sticky.component, hierarchical/autocomplete.component,
hierarchical-tree-header.component, actionbar.component, picker.ts,
video-player.component, autocomplete-multiselect.component,
form-controls/autocomplete.component, autocomplete.service,
date.component, sam-sds-autocomplete/autocomplete-search.component,
sam-sds-autocomplete/autocomplete.component, name-entry.component.

Verified: `npx tsc --noEmit` reports zero TS2554/TS2416 arity errors
across both tsconfig.json (root) and test-app's tsconfig, `npm run
lint`/`lint:baseline` pass at 1031 warnings (unchanged from the
previous baseline — these fixes were warning-neutral), `npm --prefix
test-app test` passes (152 files / 1386 tests), `npm run
validate:publish` passes.

Addresses review comments from copilot-pull-request-reviewer[bot] on
#686.

Part of #585.
@fpigeonjr
fpigeonjr marked this pull request as ready for review September 3, 2026 19:38
@fpigeonjr
fpigeonjr requested a review from a team as a code owner September 3, 2026 19:38
…d-declarations-and-const-related-lint-debt

# Conflicts:
#	eslint-baseline.json
#	src/ui-kit/components/data-table/data-table.component.ts
#	src/ui-kit/form-templates/name-entry/name-entry.spec.ts
…d-declarations-and-const-related-lint-debt

# Conflicts:
#	eslint-baseline.json
#	src/ui-kit/components/comments/comments.component.ts
#	src/ui-kit/experimental/alert/alert.component.ts
#	src/ui-kit/experimental/hierarchical/autocomplete/autocomplete.component.ts
#	src/ui-kit/experimental/hierarchical/hierarchical-test-service.spec.ts
#	src/ui-kit/experimental/listbox/listbox.component.ts
#	src/ui-kit/experimental/sideNavigationToolbar/sideNavigationToolbar/sideNavigationToolbar.component.ts
#	src/ui-kit/form-controls/autocomplete-multiselect/autocomplete-multiselect.component.ts
#	src/ui-kit/form-controls/sam-sds-autocomplete/autocomplete-search/autocomplete-search.component.ts
#	src/ui-kit/form-templates/international-phone/sam-extension/extension.component.ts
#	src/ui-kit/layout-deprecated/page.spec.ts
#	src/ui-kit/layout/pagination/pagination.component.spec.ts
beverly-n
beverly-n previously approved these changes Sep 10, 2026

@beverly-n beverly-n 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.

LGTM

…d-declarations-and-const-related-lint-debt

# Conflicts:
#	eslint-baseline.json
#	src/formly/components/autocomplete/test.service.ts
#	src/ui-kit/directives/click-outside/click-outside.spec.ts
#	src/ui-kit/directives/focus/focus.spec.ts
#	src/ui-kit/directives/sticky/sticky.component.ts
#	src/ui-kit/directives/sticky/sticky.spec.ts
#	src/ui-kit/directives/tab-outside/taboutside.spec.ts
#	src/ui-kit/elements/button/button.spec.ts
#	src/ui-kit/layout/toolbar/toolbar.spec.ts
#	src/ui-kit/wrappers/fieldset-wrapper/fieldset-wrapper.component.ts
@fpigeonjr
fpigeonjr force-pushed the gh-585-remove-unused-declarations-and-const-related-lint-debt branch from ccde018 to 6cf896e Compare September 10, 2026 18:43
@fpigeonjr
fpigeonjr requested a review from beverly-n September 10, 2026 19:25
@fpigeonjr
fpigeonjr merged commit 544fb38 into master Sep 10, 2026
8 checks passed
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.

Remove unused declarations and const-related lint debt

3 participants