Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Improve DX around prefer-global-this in TypeScript files #2488

Open
fregante opened this issue Oct 25, 2024 · 0 comments
Open

Improve DX around prefer-global-this in TypeScript files #2488

fregante opened this issue Oct 25, 2024 · 0 comments

Comments

@fregante
Copy link
Collaborator

fregante commented Oct 25, 2024

A lot of types in the wild are either only set on Window or differ between window.* and globalThis.*. These types are wrong, but they do come up when this rule is applied.

There are a few ways that this rule can help with the migration:

  • disable the rule's auto-fix in TS files
  • extend the message to specify how to specify the type
  • suggest solutions in the rule's readme

Examples:

Originally posted by @fregante in #2482 (comment)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant