Find all implicitly declared variables in directory?
I transferred 100+ js files to a directory in phpstorm and I get this error in phpstorm the they are implicitly implied variables (squiggly line and on hover shows that). In chrome console I get errors about those variables not being defined, but it works when I add the var keyword before those variables.
So the solution is to add var before those variables, but I am wondering if there is any way to scan the directory of files to point out the implicitly implied variables so I can add var in front of them? It will be very hard to do it otherwise since it's many files.
Any idea?
Please sign in to leave a comment.
Hello,
You can create a custom inspection profile at Settings | Editor | Inspections that would contain only required inspections (like JavaScript | General | Implicitly declared global JavaScript variable) and then run Code | Inspect Code with that profile - it will show you the results in a separate window where you can navigate to exact code lines from.