A great tool ESLint

ESLint is a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code, with the goal of making code more consistent and avoiding bugs. 

e.g. 

原文地址:https://www.cnblogs.com/zhangpengc/p/6507949.html