We've just started putting linting in place at my workplace, and a lot of the devs didn't realize our standards called for double-quotes everywhere. About 50% of the codebase uses single-quotes, so it's no easier to change the rule than to make the older code conform. Is there a tool or utility we could use to automatically fix older files? It's fine if we have to verify the output after, it's a lot easier to find problems in a few edge cases than to open and adjust every single file in a large codebase.
var foo = 'bar' var bat = 'baz: "stuff"'
var foo = "bar" var bat = 'baz: "stuff"' //allowed
I'm open to any method, including using an existing tool, using regex in some kind of perl or batch file, anything to avoid spending large amounts of human time fixing what is ultimately a minor problem writ large across multiple code bases. The sheer magnitude of the problem dissuades people from attempting to fix it, and I'd like a way to help with that. Please leave discussion about the wisdom of this option out of it, as this is just one of many options I'm looking into -- if there's a nice easy way to deal with it, then the team leads will want to know about it, and if there's not, that will factor into the discussion as well.
Also keep in mind that this is just the rule that's most obvious now that the linting standards are in effect. Anything that can fix other errors as well (double equals where triple was needed also comes to mind) would be useful as well.