Skip to content

Conversation

@canova
Copy link
Member

@canova canova commented Sep 29, 2025

I went ahead and checked if the Map or Set objects had unknown types at the time of their declaration in the language server. These are the things I found.

This fixes #5617.

@canova canova requested a review from mstange September 29, 2025 09:07
@codecov
Copy link

codecov bot commented Sep 29, 2025

Codecov Report

❌ Patch coverage is 95.83333% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.75%. Comparing base (01baf77) to head (1d53c92).

Files with missing lines Patch % Lines
src/actions/profile-view.ts 66.66% 1 Missing ⚠️
src/profile-logic/process-profile.ts 0.00% 1 Missing ⚠️
src/selectors/profile.ts 80.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5623   +/-   ##
=======================================
  Coverage   85.75%   85.75%           
=======================================
  Files         311      311           
  Lines       30699    30699           
  Branches     8440     8440           
=======================================
  Hits        26327    26327           
  Misses       3949     3949           
  Partials      423      423           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mstange
Copy link
Contributor

mstange commented Oct 29, 2025

Sorry for the delay here.

I'm curious why you picked const set: Set<TheType> = new Set() over const set = new Set<TheType>(); . Do you have a preference? I mostly ended up using the latter during the conversion, I think. And I think one of the type-aware lints (which we haven't enabled yet) will remove the : Set<TheType> part because it thinks it's unnecessary, so if we want to enable that lint we'll need to switch to the other form.

@canova
Copy link
Member Author

canova commented Oct 29, 2025

Heh, I knew I would get this review comment while writing this patch :) I pretty much started with writing it as new Set<TheType> and then I wanted to check the count of the existing code. So I ran rg ":.*new (Map|Set)\(\)" | wc -l and it returned 86. I ran rg "new (Map|Set)<" | wc -l and it returned 62. So I went with the most used one in the codebase.

What do you mean the type-aware lints? I'm not really familiar with them.

@canova
Copy link
Member Author

canova commented Oct 29, 2025

Actually more accurate regexp would be rg ":.*=.*new (Map|Set)\(\)" | wc -l for the first one. Still 65 though.

@mstange
Copy link
Contributor

mstange commented Nov 6, 2025

What do you mean the type-aware lints? I'm not really familiar with them.

See #5620.
Specifically I think it was @typescript-eslint/no-unnecessary-type-assertion that I had trouble with when I experimented in that PR.

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.

Check the Map constructions in the codebase to make sure that they are all typed properly

2 participants