Skip to content

Provide lib/target suggestions for findLast/findLastIndex #52220

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

Closed
DanielRosenwasser opened this issue Jan 13, 2023 · 2 comments · Fixed by #52242
Closed

Provide lib/target suggestions for findLast/findLastIndex #52220

DanielRosenwasser opened this issue Jan 13, 2023 · 2 comments · Fixed by #52242
Labels
Bug A bug in TypeScript Domain: Error Messages The issue relates to error messaging Fix Available A PR has been opened for this issue Good First Issue Well scoped, documented and has the green light Help Wanted You can do this

Comments

@DanielRosenwasser
Copy link
Member

Once #49636 goes in, we should ensure that a user gets suggestions for using findLast/findLastIndex when their output target or lib is too low.

function findLastZeroIndex(arr: number[]) {
  return arr.findLastIndex(0);
}

We already do this for other missing methods.

@DanielRosenwasser DanielRosenwasser added Bug A bug in TypeScript Help Wanted You can do this Good First Issue Well scoped, documented and has the green light Domain: Error Messages The issue relates to error messaging labels Jan 13, 2023
@DanielRosenwasser DanielRosenwasser added this to the TypeScript 5.0.1 milestone Jan 13, 2023
@OliverRadini
Copy link
Contributor

Are you happy for anyone to take a look at this? Looking to find an issue to work on

@DanielRosenwasser
Copy link
Member Author

Go for it. The code is in getScriptTargetFeatures. Add a new entry for es2023 containing entries for Array and all the TypedArray variants.

export function getScriptTargetFeatures(): ScriptTargetFeatures {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: Error Messages The issue relates to error messaging Fix Available A PR has been opened for this issue Good First Issue Well scoped, documented and has the green light Help Wanted You can do this
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants