FixMyJS (by Josh Perez) was created to try solving this problem. It aims to automatically fix linting errors in a non-destructive way. To an extent, it achieves this goal.
Under the hood the module uses Esprima for source parsing and Escodegen (from the Mozilla Parser API AST) to generate it back. While any form of automation code transformation should be approached with a healthy dose of skepticism, FixMyJS is able to handle fixing basic JSHint errors fairly well. Some of what it supports includes:Adding missing semicolonsEnforcing camelCase and snake_case conventionsAdding curly braces to statementsRemoving debugger statementsEnforcing single and double quite stylesAdding the radix parameter to parseIntDot notation conversionHandling extra trailing commas
and a few other common linting issues.
Via Jan Hesse