Skip to content

Conversation

@billyvg
Copy link
Member

@billyvg billyvg commented May 28, 2025

This fixes a type error in useRecentSearchFilters in typescript native

static/app/components/searchQueryBuilder/tokens/filterKeyListBox/useRecentSearchFilters.tsx:28:3 - error TS2322: Type 'ParseResultToken[]' is not assignable to type 'TokenResult<Token.FILTER>[]'.

h/t @scttcper

This fixes a type error in `useRecentSearchFilters` in typescript native
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label May 28, 2025
@billyvg
Copy link
Member Author

billyvg commented May 28, 2025

cc @DanielRosenwasser - I've been testing out tsgo and this was failing, not sure if it's expected or not

@billyvg billyvg marked this pull request as ready for review May 28, 2025 23:23
@DanielRosenwasser
Copy link
Contributor

This was actually the only error I wasn't able to quickly figure out. I don't think it should be expected, so feel free to file an issue on our issue tracker. If not, I'll try to get around to it later this week.

@DanielRosenwasser
Copy link
Contributor

DanielRosenwasser commented May 29, 2025

Good news! This is fixed in @typescript/[email protected]. I don't think you should need to make this change.

Presumably microsoft/typescript-go#959 fixed things (maybe microsoft/typescript-go#962, but I doubt it). @ahejlsberg may have thoughts.


More context around the original error:

static/app/components/searchQueryBuilder/tokens/filterKeyListBox/useRecentSearchFilters.tsx:28:3 - error TS2322: Type 'ParseResultToken[]' is not assignable to type 'TokenResult<Token.FILTER>[]'.
  ... Massive elaboration ...

28   return parsedQuery.filter(token => token.type === Token.FILTER);
     ~~~~~~

@billyvg
Copy link
Member Author

billyvg commented May 29, 2025

Awesome, thanks @DanielRosenwasser!

@billyvg billyvg closed this May 29, 2025
@codecov
Copy link

codecov bot commented May 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #92452      +/-   ##
==========================================
- Coverage   78.86%   75.16%   -3.71%     
==========================================
  Files       10226    10226              
  Lines      585938   585937       -1     
  Branches    22761    22761              
==========================================
- Hits       462110   440409   -21701     
- Misses     120409   142109   +21700     
  Partials     3419     3419              

@github-actions github-actions bot locked and limited conversation to collaborators Jun 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants