Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary type assertions #7357

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pjonsson
Copy link
Contributor

@pjonsson pjonsson commented Dec 9, 2024

What this PR does

These assertions do not change the type
of the expression according to tsc,
so remove the assertions.

Fix is auto-generated by the typed ESLint
typescript-eslint/no-unecessary-type-assertion
rule.

Test me

Run tsc on the sources/tested by CI.

Checklist

  • There are unit tests to verify my changes are correct or unit tests aren't applicable (if so, write quick reason why unit tests don't exist)
  • I've updated relevant documentation in doc/.
  • I've updated CHANGES.md with what I changed.
  • I've provided instructions in the PR description on how to test this PR.

@pjonsson pjonsson force-pushed the remove-unnecessary-type-assertion branch from a8d3b74 to d702e29 Compare January 3, 2025 13:54
@@ -145,7 +145,7 @@ class GeoJsonCatalogItem
// FeatureCollection to JsonValue
jsonData = mergeFeatureCollections(
featureCollections
) as any as JsonValue;
) as unknown as JsonValue;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since this change removes most as any as, I changed the 3 remaining ones into as unknown as to fix some complaints from ESLint about using the any type.

@pjonsson pjonsson force-pushed the remove-unnecessary-type-assertion branch from d702e29 to 4c98869 Compare January 3, 2025 14:00
@pjonsson pjonsson force-pushed the remove-unnecessary-type-assertion branch from 4c98869 to 4e62128 Compare February 12, 2025 13:36
These assertions do not change the type
of the expression according to tsc,
so remove the assertions.

Fix is auto-generated by the typed ESLint
typescript-eslint/no-unecessary-type-assertion
rule.
@pjonsson pjonsson force-pushed the remove-unnecessary-type-assertion branch from 4e62128 to ed41f44 Compare February 20, 2025 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant