Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix this warning 'var' used instead of 'let' or 'const' JsLint in phpStrom?

I want to fix this in the code file not in jslint setting options. The JS file is in PHP project. How can I remove the warning from here?

like image 418
rajwa766 Avatar asked Feb 06 '19 10:02

rajwa766


3 Answers

Open PhpStorm Settings -> Languages & Framework -> Javascript and in "JavaScript language version" dropdown select EcmaScript 5

like image 111
anfen Avatar answered Oct 17 '22 07:10

anfen


in Settings , find Inspections tab . Then find the one denoted in picture below (which is "'var' used instead of 'let' or 'const'", and change the severity to no highlighting.

The squiggling line disappears after you apply this new setting.

like image 32
Lysander Avatar answered Oct 17 '22 07:10

Lysander


When using multiple versions of JavaScript language in your project, you can also set specific JavaScript language version for each directory (e.g. when you're using ECMAScript 5.1 in views in <script> tag, but assets are written in ECMAScript 6+)...

enter image description here

like image 2
Jakub Adamec Avatar answered Oct 17 '22 06:10

Jakub Adamec