Skip to content

Commit

Permalink
Merge pull request #3 from chadfawcett/exported-config
Browse files Browse the repository at this point in the history
v2.0.0 - Change config to be an exported JS object
  • Loading branch information
chadfawcett authored Apr 3, 2018
2 parents 969a6c7 + 0e280da commit 734674a
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 18 deletions.
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 2 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
5 changes: 5 additions & 0 deletions prettier.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
semi: false,
singleQuote: true,
jsxBracketSameLine: true
}
9 changes: 0 additions & 9 deletions prettierrc

This file was deleted.

0 comments on commit 734674a

Please sign in to comment.