type-assertion-lint-hardening: Restore strict type assertion linting #5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "task/type-assertion-lint-hardening"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.