Auto-modernize code based on inspection suggestions?

I'm going through an old JavaScript file and noticing a lot of corrections that PHPStorm is suggesting, and after hovering over the gray-underlined property and selecting Simplify (which does things like change `var` to `const` or `let`, and simplifying arrays), I would prefer to just have something automatically simplify all of the suggestions in the code.

Example:

Is this possible?

0

Code Cleanup should do the trick here. Help | Find Action | Code Cleanup...

1

Thanks. I'm not seeing however how to do it by selection.

0

Unfortunately, the minimal scope for Code Clean up is the whole file, you can't run it against selected part of code.

Or do you mean a menu option? In this case, you may find it in "Code > Code cleanup..." menu window.

0

请先登录再写评论。