動作環境
$ 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
}