Code formatting?

Hi all,

New to Replit. I was experimenting with a Node.js repl & wanted to both be able to run a formatter on my code & have the autocomplete also adhere to this formatter automatically.

I’d also like to use a different code format, such as Standard.js. How do I accomplish these here?

Thanks!

2 Likes

Hi @zkstorm thanks for your question and welcome to the community!

Sorry for the time it took to investigate this and get back to you.

I got the following information from JavaScript Standard Style

  1. Go to the Shell and type:
npm install standard --global
  1. Write Javascript code as normal

  2. In the Shell type:

standard --fix

And your code will automatically be formatted. Ta da!

Feel free to fork https://replit.com/@IanAtReplit/CodeFormatter if this helps.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.