Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

🐛 Some TypeScript utility types detected as undeclared with noUndeclaredVariables enabled #4643

Closed
1 task done
public opened this issue Jun 30, 2023 · 2 comments · Fixed by #4644
Closed
1 task done
Assignees
Labels
I-Easy Implementation: easy task, usually a good fit for new contributors S-Bug: confirmed Status: report has been confirmed as a valid bug

Comments

@public
Copy link

public commented Jun 30, 2023

Environment information

Playground and nightly.

What happened?

Playground Example

Rome doesn't seem to know about all of the utility types that exist in TS.

For example:

async function f() {}

type T = Awaited<typeof f>;

The noUndeclaredVariables rule will claim Awaited is not defined. This is not true. It is built in. There are probably more of these.

Expected result

All TypeScript utility types are treated as declared.

Code of Conduct

  • I agree to follow Rome's Code of Conduct
@public public added the S-To triage Status: user report of a possible bug that needs to be triaged label Jun 30, 2023
@public
Copy link
Author

public commented Jun 30, 2023

@Conaclos Conaclos added S-Bug: confirmed Status: report has been confirmed as a valid bug I-Easy Implementation: easy task, usually a good fit for new contributors and removed S-To triage Status: user report of a possible bug that needs to be triaged labels Jun 30, 2023
@ematipico
Copy link
Contributor

Previously #4458

Do they just need adding in here? https://github.com/rome/tools/blob/bbe819ef9a30e19d757285bb6cfcf50141d59a05/crates/rome_js_analyze/src/globals/typescript.rs

Yeah probably they are outdated and need to be updated.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
I-Easy Implementation: easy task, usually a good fit for new contributors S-Bug: confirmed Status: report has been confirmed as a valid bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants