Created
October 29, 2021 09:47
-
-
Save muchirijane/ab08a602ad6f9e91e65d9ecd46adaa33 to your computer and use it in GitHub Desktop.
How to config your file with prettier
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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