-
Notifications
You must be signed in to change notification settings - Fork 887
Conversation
Thanks for your interest in palantir/tslint, @danielreichhart! Before we can accept your pull request, you need to sign our contributor license agreement - just visit https://cla.palantir.com/ and follow the instructions. Once you sign, I'll automatically update this pull request. |
package.json
Outdated
"json-stringify-pretty-compact": "^1.0.3", | ||
"mocha": "^3.2.0", | ||
"npm-run-all": "^4.0.2", | ||
"nyc": "^10.2.0", | ||
"prettier": "^1.13.7", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like the documentation pointed out https://prettier.io/docs/en/install.html
Use exact version instead of ^ or ~
Only use 1.13.7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. I changed it.
@@ -26,3 +26,6 @@ docs/formatters/*/index.html | |||
|
|||
/coverage/ | |||
/.nyc_output | |||
|
|||
# ide |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a huge problem here, but try to do only one thing in a PR
The repository owner can not cerry-pick like in GitLab (in the GitHub GUI)
Why is prettier needed? From my expirience it makes development less convenient (I'm talking only about typescript):
|
Okay, that’s right. But in my opinion, it reduces the readability only in few edge cases. In general, it improves it. For the few cases, we could open an issue or a pull request at the prettier project. You can define the line length in the .prettierrc config file. The current print width is 120 chars. If it makes the PR management more complicated, we could increase the length. |
I agree that prettier is a good idea to add here: in the majority of cases, it simplifies code style and makes it easier to review PRs - there no longer needs to be checks of code layout/formatting as prettier enforces this. @danielreichhart any idea why the tests are failing after this change? It might not be an issue with this PR but we should figure it out before merging. |
I merged the PR for the failing tests - could you merge master into your PR and re-push? |
# Conflicts: # yarn.lock
@johnwiseheart done |
.prettierrc.json
Outdated
@@ -0,0 +1,4 @@ | |||
{ | |||
"tabWidth": 4, | |||
"printWidth": 120 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about having a print width of 120
- the prettier docs specifically mention why the default of 80 makes sense. @giladgray do you have any comments here? Maybe we could set it to 100
so its in the middle.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@johnwiseheart @giladgray are there any news?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO 100 is a good choice because you can see the changes in a commit side by side without scrolling (on a 1080p monitor)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’ve always worked with 120, but 100 is a good compromise.
Also, the point the commit changes without scrolling is a good point.
Thanks for contributing! |
palantir#4012 added prettier support but then didn't run it over everything and turned it on for YAML files despite using a version that doesn't support YAML. This: * Upgrades Prettier to 1.14 whic adds yml support. * Turns on `trailing commas = all` as that seems to be what most of the code is doing. * Runs prettier over everything This also has the bonus of making future PRs much smaller.
PR checklist
Overview of change:
Is there anything you'd like reviewers to focus on?
CHANGELOG.md entry: