Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make prettier a peerDependency #1

Merged
merged 1 commit into from
Jan 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ Next, install `eslint-plugin-prettier`:
$ npm install eslint-plugin-prettier --save-dev
```

Finally, install `prettier`:

```
$ npm install prettier --save-dev
```

**Note:** If you installed ESLint globally (using the `-g` flag) then you must also install `eslint-plugin-prettier` globally.

## Usage
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,19 @@
},
"homepage": "https://github.com/not-an-aardvark/eslint-plugin-prettier#readme",
"dependencies": {
"prettier": "^0.11.0",
"requireindex": "~1.1.0"
},
"peerDependencies": {
"eslint": "^3.14.1"
"eslint": "^3.14.1",
"prettier": ">= 0.11.0"
},
"devDependencies": {
"eslint": "^3.14.1",
"eslint-config-not-an-aardvark": "^2.0.0",
"eslint-plugin-eslint-plugin": "^0.2.1",
"eslint-plugin-node": "^3.0.5",
"mocha": "^3.1.2"
"mocha": "^3.1.2",
"prettier": ">= 0.11.0"
Copy link
Member Author

@lydell lydell Jan 28, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version range does not technically have to be >= 0.11.0 here; ^0.11.0 could work as well. I thought it might be a good idea to use the same range as the peerDependency, though, to make sure that the tests pass when using the latest version allowed by the peerDependency. When I made the PR, the latest version of prettier on npm was 0.11.0. Now, when the PR was merged, 0.13.1 has been released, with slightly different output. I didn’t realize that this repo uses prettier for linting itself, which caused Travis to fail on the merge commit. Thoughts?

  • Change the devDependency version constraint?
  • Remove prettier from the eslint rules of this module?
  • Just live with it, and re-format the files every now and then?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose I'll pin the version of prettier that this module uses to lint itself so that the build doesn't unexpectedly break.

},
"engines": {
"node": ">=4.0.0"
Expand Down