diff --git a/README.md b/README.md index 759b289..5ffa732 100644 --- a/README.md +++ b/README.md @@ -2,14 +2,24 @@ ## Usage -Installing the package will make a symlink in the root of your project to the -prettier config in this repo. It is recommended to add `.prettierrc` to your -`.gitignore` so you don't accidentally commit the symlink. - ```bash npm install --save-dev @twostoryrobot/prettier ``` +Then you can source the config from your own `prettier.config.js`. + +```js +module.exports = require('@twostoryrobot/prettier') +``` + +Or if you want to override the default at all (Note: please consider making a PR +if you think the override will be useful for other projects). + +```js +const prettierConfig = require('@twostoryrobot/prettier') +module.exports = Object.assign({}, prettierConfig, { semi: true }) +``` + Make sure to install the peer dependencies ```bash diff --git a/package.json b/package.json index c6bd74b..696719b 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,8 @@ { "name": "@twostoryrobot/prettier", - "version": "1.0.0", + "version": "2.0.0", "description": "prettier configuration for Two Story Robot", - "main": "index.js", - "scripts": { - "postinstall": "ln -fs $(pwd)/prettierrc $(pwd)/../../../.prettierrc" - }, + "main": "prettier.config.js", "repository": { "type": "git", "url": "git+https://github.com/TwoStoryRobot/prettier-config.git" diff --git a/prettier.config.js b/prettier.config.js new file mode 100644 index 0000000..ca1a4a6 --- /dev/null +++ b/prettier.config.js @@ -0,0 +1,5 @@ +module.exports = { + semi: false, + singleQuote: true, + jsxBracketSameLine: true +} diff --git a/prettierrc b/prettierrc deleted file mode 100644 index 1be26a0..0000000 --- a/prettierrc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "semi": false, - "singleQuote": true, - "jsxBracketSameLine": true, - "overrides": [{ - "files": ".prettierrc", - "options": { "parser": "json" } - }] -}