Skip to content

Instantly share code, notes, and snippets.

@muchirijane
Created October 29, 2021 09:47
Show Gist options
  • Save muchirijane/ab08a602ad6f9e91e65d9ecd46adaa33 to your computer and use it in GitHub Desktop.
Save muchirijane/ab08a602ad6f9e91e65d9ecd46adaa33 to your computer and use it in GitHub Desktop.
How to config your file with prettier
1) install prettier
npm install --save-dev --save-exact prettier
2) Add prettier formart in your package.json file under scripts
"scripts": {
"prettier-format": "npx prettier --write .",
"prettier-check": "npx prettier --check ."
},
3) Add prettier.config.js file and ingore file
module.exports = {
trailingComma: 'es5',
tabWidth: 2,
semi: false,
singleQuote: true,
}
////////////
prettierignore
build
coverage
.package-lock.json
node_modules
4) To formart your code run
npm run prettier-formart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment