21
11

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[ESLint] "window" is not definedで怒られないようにする

Posted at

内容

eslintでno-undefのルールを定めている場合、windowなどのグローバルな変数もエラーとなってしまうので、エラーとならないようにする設定を記載します。

設定

といってもやることは簡単で、設定ファイル(.eslintrcまたはeslintConfigまたはpackage.json)に"globals"を定義するだけでした。

.eslintrc
{
  ...
  "globals": {
    "window": true
  },
  ...
}
21
11
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
21
11

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?