Prettier is a code formatter that outputs code in a consistent style.
See more details: What is Prettier?
npm install --save-dev --save-exact prettier
Optional: Create an empty config file:
node --eval "fs.writeFileSync('.prettierrc','{}\n')"
Optional: Create a .prettierignore file to define what not to format
node --eval "fs.writeFileSync('.prettierignore','# Ignore artifacts:\nbuild\ncoverage\n')"
Find more details in the Prettier installation documentation.
Install via VSCode Marketplace
For more details on installation and default config see the Prettier VSCode documentation.
npx prettier --check .
NOTE: For large files and repos this might take while.
npx prettier --write .
Ex.
npx prettier --write .github/workflows/lint*