Adding as npm script did the trick for me:
- package.json defined npm script
It will recursively fix following files.ext with the following set of rules defined in prettierrc
file.
Important: .<EXTENSION || MULTIPLE_EXTENSIONS> e.g'./src/**/*.{js,jsx,scss,md,json}' (Include all files and folders)
- Don't miss the quotes -> ' PATH>.<EXTENSION || MULTIPLE_EXTENSIONS> '
{
"name": "compentence-journey",
"version": "0.1.0",
"private": true,
"scripts": {
"prettier.fix": "prettier --check --write './src/**/*.{js,jsx,scss,md,json}'",
},
...
}
{
"trailingComma": "es5",
"tabWidth": 4,
"semi": false,
"singleQuote": true
}
- .prettierignore ignore folder/files from formatting
/config
# Dependency directories
node_modules/
# Publish Directory
build/
# Root level folders/files
/package.json