0
0

More than 3 years have passed since last update.

eslint において、 while(1)で警告が出るのを.eslintrc.json の設定で回避する方法

Posted at

動作環境

$ node -v
v15.14.0
$ npm -v
7.7.6
$ npm list --depth=0
eslint@7.32.0

目的

  • eslint を使っていて、 while(1)を書くだけでeslintの警告が出るのをなんとかしたい。

コードを変えて警告を回避する方法

  • .eslintrc.json 設定を変更しない場合は、以下のように変更して回避する
  [NG] while (1) {}
  [OK] for (;;) {}

.eslintrc.jsonを設定して回避する方法

  • .eslintrc.json 設定を変更して回避する場合は、以下のように指定する。
  "rules": {
    "no-constant-condition": 0
  }
0
0
0

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
0
0