@mskcc/prettier-config
v2.7.2
Published
Prettier config for MSKCC projects
Downloads
437
Readme
@mskcc/prettier-config
A prettier shareable config for mskcc projects.
Installation
npm install --save-dev prettier // Actual prettier
npm install --save-dev @mskcc/prettier-config // configuration file
This is only a shareable configuration. It does not install Prettier or any other part of the tool chain.
Usage
Reference it in package.json
using the prettier
property:
{
"name": "my-projects-name",
"prettier": "@mskcc/prettier-config",
"devDependencies" : {
"@mskcc/prettier-config": "^0.7.0"
}
}
If you don't want to use package.json
, you can use any of the supported
extensions to export a string:
// .prettierrc.json
"@mskcc/prettier-config"
// prettier.config.js or .prettierrc.js
module.exports = '@mskcc/prettier-config';
Adding custom rules
- Create a JavaScript configuration file
.prettierrc.js
. - Import the configuration file.
- Export the modified configuration
// .prettierrc.js
const prettierConfig = require('@mskcc/prettier-config');
module.exports = {
...prettierConfig,
printWidth: 100
};