@creolabs/prettier-config
v1.0.0
Published
This is a minimal configuration for Prettier that is intended to provide a consistent (and automatic) format to Creo projects
Downloads
2
Maintainers
Readme
Creo Prettier Config
This is a minimal configuration for Prettier that is intended to provide a consistent (and automatic) format to Creo projects
TL;DR Installation
npm install -D @creolabs/prettier-config
Add the following to your package.json
"prettier": "@creolabs/prettier-config"
Make sure the VSCode extension is installed.
Full Installation
To install this package run the following command in the terminal in the root directory of your application.
npm install -D @creolabs/prettier-config
The peer dependencies (prettier) will automatically be installed.
Usage
Add a key in your package.json file.
"prettier": "@creolabs/prettier-config"
OR
Create a .prettierrc , .prettierrc.yaml , .prettierrc.yml or .prettierrc.json file and export a string.
"@creolabs/prettier-config"
OR
Create a prettier.config.js or .prettierrc.js file and export an object.
module.exports = {
...require("@creolabs/prettier-config"),
// endOfLine: 'lf', // to overwrite the property
};
Read more on Prettier configuration.
VSCode
If you're using VSCode then make sure the Prettier extension is installed.
You may wish to add the following configuration to format code on save:
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
Philosophy
By far the biggest reason for adopting Prettier is to stop all the on-going debates over styles.