I am trying to use ESLint to provide a coding style in a project, and I have many errors Irregular whitespace not allowedcaused by code like this:
var a = b || 10; //note the 2 spaces between || and 10
if (a === 10) { // again, 2 spaces between ) and {
I did not find a way to easily solve this problem for all my files. I think that the basic regular expression will not work, because in some situations double spaces are acceptable (indentation of a column of a JSON object, indentation with soft tabs, lines).
I tried a tool like js-beautify, but did not find any options to solve this problem. Is there a tool that could help me?
source
share