type-assertion-lint-hardening: Restore strict type assertion linting #5

Open
std-bot wants to merge 1 commit from task/type-assertion-lint-hardening into main
First-time contributor

Assigned idea

Re-enable strict enforcement for TypeScript type assertions by fixing remaining violations and changing @typescript-eslint/consistent-type-assertions from warn back to error.

Approach: Use eslint.config.mjs as the target policy file. Run ESLint against src/**/*.ts to find current @typescript-eslint/consistent-type-assertions warnings, replace unsafe or unnecessary assertions with typed variables, narrowing, generics, or validated helper functions, then update the rule severity in eslint.config.mjs to error and remove the migration comment if it is no longer accurate.

Verification: Confirm eslint.config.mjs sets "@typescript-eslint/consistent-type-assertions": "error", then run npx eslint "src/**/*.ts" --quiet and ensure it exits successfully.

Risk: Some assertions may encode assumptions that are not currently validated at runtime, so replacing them may require small refactors or explicit guards rather than mechanical edits.

Agent context

Task slug: type-assertion-lint-hardening
Branch: task/type-assertion-lint-hardening

## Assigned idea Re-enable strict enforcement for TypeScript type assertions by fixing remaining violations and changing @typescript-eslint/consistent-type-assertions from warn back to error. Approach: Use eslint.config.mjs as the target policy file. Run ESLint against src/**/*.ts to find current @typescript-eslint/consistent-type-assertions warnings, replace unsafe or unnecessary assertions with typed variables, narrowing, generics, or validated helper functions, then update the rule severity in eslint.config.mjs to error and remove the migration comment if it is no longer accurate. Verification: Confirm eslint.config.mjs sets "@typescript-eslint/consistent-type-assertions": "error", then run npx eslint "src/**/*.ts" --quiet and ensure it exits successfully. Risk: Some assertions may encode assumptions that are not currently validated at runtime, so replacing them may require small refactors or explicit guards rather than mechanical edits. ## Agent context Task slug: type-assertion-lint-hardening Branch: task/type-assertion-lint-hardening <!-- std-ts:idea-pr-body -->
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin task/type-assertion-lint-hardening:task/type-assertion-lint-hardening
git switch task/type-assertion-lint-hardening

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff task/type-assertion-lint-hardening
git switch task/type-assertion-lint-hardening
git rebase main
git switch main
git merge --ff-only task/type-assertion-lint-hardening
git switch task/type-assertion-lint-hardening
git rebase main
git switch main
git merge --no-ff task/type-assertion-lint-hardening
git switch main
git merge --squash task/type-assertion-lint-hardening
git switch main
git merge --ff-only task/type-assertion-lint-hardening
git switch main
git merge task/type-assertion-lint-hardening
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
snorkel/root-repository-maintenance-4a9d6ef2d06f43!5
No description provided.