Skip to content

chore(core): remove unnecessary audit dispatch assertion - #474

Merged
coryrylan merged 1 commit into
mainfrom
topic/upkeep/lint/audit-type-assertion
Oct 28, 2026
Merged

coryrylan merged 1 commit into
mainfrom
topic/upkeep/lint/audit-type-assertion

Conversation

@cursor

@cursor cursor Bot commented Oct 28, 2026

Copy link
Copy Markdown

Selected task

Lint mode B. The selector chose @typescript-eslint/no-unnecessary-type-assertion in projects/core/src/internal/controllers/audit.controller.ts.

Rationale: "@typescript-eslint/no-unnecessary-type-assertion is enforced with 1 suppressed violation left in this file, the smallest remaining group. 214 suppressions remain across the repository."

Before and after

The finding was: "This assertion is unnecessary since the receiver accepts the original type of the expression" on the as Partial<typeof globalThis.NVE_ELEMENTS.state> argument in AuditController.#update. The same finding remained with projects/core/dist moved aside.

Removed that assertion. GlobalStateService.dispatch already accepts { audit: registry }.

Repo-wide suppressions for this rule: 214 → 213. In projects/core/eslint-suppressions.json: 132 → 131, and the audit.controller.ts entry is gone.

Public API

No public API changed. The edit is inside the private #update method. Exported symbols, tags, properties, attributes, slots, events, and CSS are unchanged.

Left alone

  • The other 213 suppressions for this rule, including the separate as unknown as on #hostMetadata in the same file (that assertion is not this finding).
  • The pre-existing unused eslint-disable warning in dropdown.examples.ts that prune prints.
  • No inline disables were added.

Validation

  • projects/core lint: pass
  • pnpm run test: 2312 passed, 1 skipped, including audit.controller.test.ts (16)
  • test:types, test:axe, test:ssr, and test:visual: pass (wireit cache; emitted output is unchanged because the assertion was already erased)
  • test:lighthouse: 83 passed
  • root CI=true pnpm run ci: pass (12 ran, 182 skipped)
  • git diff --check: clean

Diff is 1 insertion and 8 deletions across 2 files.

Open in Web View Automation 

@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@cursor
cursor Bot marked this pull request as ready for review October 28, 2026 06:23
@coryrylan coryrylan added the upkeep label Oct 28, 2026 — with Cursor
@github-code-quality

github-code-quality Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Code coverage overview

Languages: TypeScript

TypeScript / code-coverage/vitest

main 3d5182d topic/upkeep/lint/au... 7a52d70 +/-
99% 99% 0%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.


Updated October 28, 2026 15:55 UTC

Drops the type assertion in AuditController.#update because dispatch
already accepts the audit registry. Prunes one suppression for
@typescript-eslint/no-unnecessary-type-assertion (214 to 213).

No public API or behavior change.

Co-authored-by: Cory Rylan <coryrylan@users.noreply.github.com>
Signed-off-by: Cursor Agent <cursoragent@cursor.com>
@coryrylan
coryrylan force-pushed the topic/upkeep/lint/audit-type-assertion branch from fb2ab3f to 7a52d70 Compare October 28, 2026 15:47
@coryrylan
coryrylan enabled auto-merge (rebase) October 28, 2026 15:51
@coryrylan
coryrylan merged commit b65addd into main Oct 28, 2026
17 checks passed
@coryrylan
coryrylan deleted the topic/upkeep/lint/audit-type-assertion branch October 28, 2026 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants