Scentre Group Prettier Config
This package contains Scentre Group's Prettier configuration.
Usage
- Run
yarn add prettier@1.8.2 @scentregroup/prettier-config --dev
- Run
touch .prettierrc.js
- Add the following snippet to the file:
module.exports = require('@scentregroup/prettier-config')
- Add a
format
task to scripts
in package.json
: prettier --write '**/*.{js,css,scss}'
- If you would like a watch task for format,
yarn add onchange --dev
, and add a format:watch
task to scripts
in package.json
: onchange '**/*.{js,css,scss}' -- prettier --write {{changed}}
Development
If you would like to try out the repository locally:
- Run
git clone git@github.com:ScentreGroup/javascript_config.git
cd javascript_config/prettier-config
- Create a global link to this repository via
yarn link
- In the repository you would like to test, run
yarn link @scentregroup/prettier-config
. - You can then proceed as per the Usage section.
Contents
This configuration file changes the following:
- Removes unnecessary semicolons
- Enforces the use of single quotes instead of double quotes