I am touching an old JavaScript project to add new features. The existing codebase is written like #1 and #2. I like it to be like #3.

codebase #1 function x (a,b){ c(d('fff')).run('ggg'); }

codebase #2 function x(a,b) { c( d('fff')).run('ggg');}

codebase #3 function x (a,b) { c( d( 'fff' )).run( 'ggg' );}

Is there a tool to format the existing codebase to be like #3? If there is not, I'd like to write this tool, is it worth doing? Or there's a better way of dealing with this?

  • Seriously, please avoid copy/pasting posts across the network, it's rude to the websites. Tailor your posts to each specific website. Your question fails the second point here as you don't provide a clear list of requirements. – Kyll Jun 20 '16 at 7:48
  • 2
    Literal copy-paste from this deleted SO question. fireflies, you were asked to: "make sure to read their help center carefully and to avoid just copy/pasting your question there, instead tailoring it to this specific site." – Cerbrus Jun 20 '16 at 7:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.