sindresorhus/eslint-plugin-unicorn

Improve DX around `prefer-global-this` in TypeScript files

クローズ

#2,488 opened on 2024/10/25

 (0 件のコメント) (1 件のリアクション) (0 人の担当者)JavaScript (468 件のフォーク)user submission
docsenhancementhelp wanted

Repository metrics

Stars
 (5,022 個のスター)
PR merge metrics
 (平均マージ 4h 30m) (30d で 26 merged PRs)

説明

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 https://github.com/sindresorhus/eslint-plugin-unicorn/issues/2482#issuecomment-2424797467

コントリビューターガイド