Remove trailing semicolons:
find . -path ./node_modules -prune -o -type f -name '*.js' -exec sed -i '' -e 's/;$//' {} \;
Ensure space between function and opening bracket:
find . -path ./node_modules -prune -o -type f -name '*.js' -exec sed -i '' -e 's/function(/function (/g' {} \;
Ensure space after colons in object literal:
find . -path ./node_modules -prune -o -type f -name '*.js' -exec sed -i '' -E -e 's/:([^ ])/: \1/g' {} \;
Ensure space after commas in object literal:
find . -path ./node_modules -prune -o -type f -name '*.js' -exec sed -i '' -E -e 's/,([^ ])/, \1/g' {} \;
Use single quotes when defining strings:
Note that this is by no means not foolprof as it will also convert the double quotes in the string 'foo"bar'!
find . -path ./node_modules -prune -o -type f -name '*.js' -exec sed -i '' -E -e "s/\"/'/g" {} \;
Remove space in front of colons:
find . -path ./node_modules -prune -o -type f -name '*.js' -exec sed -i '' -e 's/ *,/,/g' {} \;
Remove trailing line space:
find . -path ./node_modules -prune -o -type f -name '*.js' -exec sed -i '' -e 's/ *$//' {} \;
Is this better than using standard-format, esformat, etc that is used by ogdens module?