Search code examples
webstorm

WebStorm - remove console.log before every commit


How can I configure WebStorm IDE to automatically check and clean the code from all console.log on every commit?


Solution

  • There is no option for this in the IDE, but you can use the packages available on the web and either include them in your build process or run as a pre-commit hook. See babel-plugin-transform-remove-console, uglifyjs-webpack-plugin