-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Upgrade to Prettier 1.8 #4852
Upgrade to Prettier 1.8 #4852
Conversation
docs/Configuration.md
Outdated
"^[./a-zA-Z0-9$_-]+\.png$": "<rootDir>/RelativeImageStub.js", | ||
"module_name_(.*)": "<rootDir>/substituted_module_$1.js" | ||
} | ||
"^[./a-zA-Z0-9$_-]+.png$": "<rootDir>/RelativeImageStub.js", |
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.
The removal of the \
is safe, I guess?
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.
Should it be \\
?
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.
Yeah it probably found a bug in your regex :P
Codecov Report
@@ Coverage Diff @@
## master #4852 +/- ##
=======================================
Coverage 59.25% 59.25%
=======================================
Files 200 200
Lines 6646 6646
Branches 4 4
=======================================
Hits 3938 3938
Misses 2708 2708
Continue to review full report at Codecov.
|
docs/Configuration.md
Outdated
implementation that may have been provided. | ||
|
||
### `reporters` [array<moduleName | [moduleName, | ||
options]>] |
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.
This looks wrong
docs/GettingStarted.md
Outdated
{ | ||
// package.json |
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 valid json anyways, but should it be moved?
docs/TutorialReact.md
Outdated
{ | ||
"presets": ["es2015", "react"] | ||
// .babelrc |
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.
Another move
docs/Webpack.md
Outdated
{ | ||
// package.json |
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.
And another
package.json
Outdated
@@ -85,6 +85,7 @@ | |||
"jest-coverage": "yarn jest --coverage", | |||
"lint": "eslint . --cache --ext js,md", | |||
"lint-es5-build": "eslint --no-eslintrc --no-ignore --env=browser packages/*/build-es5", | |||
"lint:md": "prettier --bracket-spacing false --single-quote --trailing-comma all docs/**/*md packages/*/README.md website/blog/* --write", |
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.
Should we add a prettierrc instead? Should be nicer for tooling
@@ -442,7 +442,9 @@ describe( | |||
jestExpect(big).toBeGreaterThanOrEqual(small); | |||
}); | |||
|
|||
it(`{pass: false} expect(${small}).toBeGreaterThanOrEqual(${big})`, () => { | |||
it(`{pass: false} expect(${small}).toBeGreaterThanOrEqual(${ | |||
big |
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.
Ew...
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 thought test
, it
etc was special-cased to not break?
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.
Kind of - the special case is for arguments, not stuff inside the template literal.
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 can see the indentation is untouched, so probably not an issue
packages/pretty-format/README.md
Outdated
| `theme` | `object` | | colors to highlight syntax in terminal | | ||
|
||
Property values of `theme` are from [ansi-styles colors](https://github.com/chalk/ansi-styles#colors) | ||
| key | type | default | description | |
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 found 2 bugs which I think should block the markdown part: prettier/prettier#3169 and prettier/prettier#3168 |
@@ -389,7 +389,9 @@ const getColorsHighlight = (options: OptionsReceived): Colors => | |||
colors[key] = color; | |||
} else { | |||
throw new Error( | |||
`pretty-format: Option "theme" has a key "${key}" whose value "${value}" is undefined in ansi-styles.`, |
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.
It was easier to read before, IMO
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.
Yeah but looks like it exceeds printWidth
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.
It does, but it's way easier to read.
Same as long string are unbroken, I would prefer there to not be a break in long template strings, at least as long as there's just single variables in the ${}
parts
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
This upgrades to the fresh prettier 1.8 release. It also formats all markdown files with it.
I'm not sure if the md lint should be part of the normal
yarn lint
run?I tried removing the ignore of md files from the prettier eslint rule, but prettier then expected trailing newline in the codeblock. So I left it alone 🙂
Test plan
Green CI