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

front: turn on @typescript-eslint/no-unnecessary-type-assertion lint #8785

Merged
merged 2 commits into from
Sep 10, 2024

Conversation

emersion
Copy link
Member

@emersion emersion commented Sep 6, 2024

First part of #8772

Enable typed hinting so that ESLint has information about types
and can provide more feedback. Only enable a single typed lint
rule for now (rest will be a lot more work to fix).

The rule @typescript-eslint/no-unnecessary-type-assertion prevents
unnecessary type assertions (e.g. casting a string to a string).
Reducing type assertions is nice because type assertions override
type checking and thus may hide type mismatches.

@emersion emersion requested review from kmer2016 and Yohh September 6, 2024 07:08
@emersion emersion marked this pull request as ready for review September 6, 2024 07:08
@emersion emersion requested a review from a team as a code owner September 6, 2024 07:08
@emersion emersion self-assigned this Sep 6, 2024
@emersion emersion force-pushed the emr/unnecessary-type-assertions branch from a71e720 to ec7fbb6 Compare September 6, 2024 07:32
Copy link
Contributor

@kmer2016 kmer2016 left a comment

Choose a reason for hiding this comment

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

LGTM !

@emersion emersion enabled auto-merge September 9, 2024 16:44
@emersion emersion force-pushed the emr/unnecessary-type-assertions branch 2 times, most recently from 2a0a9b4 to 54752b1 Compare September 10, 2024 07:00
First part of #8772

Enable typed hinting so that ESLint has information about types
and can provide more feedback. Only enable a single typed lint
rule for now (rest will be a lot more work to fix).

The rule @typescript-eslint/no-unnecessary-type-assertion prevents
unnecessary type assertions (casting a string to a string).
Reducing type assertions is nice because type assertions override
type checking and thus may hide type mismatches.

Signed-off-by: Simon Ser <[email protected]>
Generated via eslint --fix, then fixed up two issues in:

- src/utils/mapHelper.ts
- src/common/Map/WarpedMap/core/projection.ts

Signed-off-by: Simon Ser <[email protected]>
@emersion emersion force-pushed the emr/unnecessary-type-assertions branch from 54752b1 to 8c29554 Compare September 10, 2024 07:01
@emersion emersion added this pull request to the merge queue Sep 10, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Sep 10, 2024
@emersion emersion added this pull request to the merge queue Sep 10, 2024
@emersion emersion removed this pull request from the merge queue due to a manual request Sep 10, 2024
@emersion emersion added this pull request to the merge queue Sep 10, 2024
Merged via the queue into dev with commit 08f26b3 Sep 10, 2024
23 checks passed
@emersion emersion deleted the emr/unnecessary-type-assertions branch September 10, 2024 10:18
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.

3 participants