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

Suggestion: Support readonly interfaces in getSuggestedLibFor... #61323

Open
6 tasks done
Renegade334 opened this issue Mar 1, 2025 · 0 comments
Open
6 tasks done

Suggestion: Support readonly interfaces in getSuggestedLibFor... #61323

Renegade334 opened this issue Mar 1, 2025 · 0 comments

Comments

@Renegade334
Copy link
Contributor

πŸ” Search Terms

readonly target library

βœ… Viability Checklist

⭐ Suggestion

Read-only variants of ECMAScript interfaces are currently not eligible for script target suggestions. This is most noticeable with ReadonlyArray, since this type can arise through syntax rather than by referencing the symbol directly.

[1,2,3].toReversed();
//      ~~~~~~~~~~
// Property 'toReversed' does not exist on type 'number[]'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2023' or later.

([1,2,3] as const).toReversed();
//                 ~~~~~~~~~~
// Property 'toReversed' does not exist on type 'readonly [1, 2, 3]'.

It would be useful if the suggested lib checks could resolve these in the same way.

πŸ“ƒ Motivating Example

As above.

πŸ’» Use Cases

N/A

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

No branches or pull requests

1 participant