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

Upgrade to Prettier 1.8 #4852

Merged
merged 2 commits into from
Nov 7, 2017
Merged

Upgrade to Prettier 1.8 #4852

merged 2 commits into from
Nov 7, 2017

Conversation

SimenB
Copy link
Member

@SimenB SimenB commented Nov 7, 2017

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

"^[./a-zA-Z0-9$_-]+\.png$": "<rootDir>/RelativeImageStub.js",
"module_name_(.*)": "<rootDir>/substituted_module_$1.js"
}
"^[./a-zA-Z0-9$_-]+.png$": "<rootDir>/RelativeImageStub.js",
Copy link
Member Author

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?

Copy link
Member Author

Choose a reason for hiding this comment

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

Should it be \\?

Copy link
Contributor

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-io
Copy link

codecov-io commented Nov 7, 2017

Codecov Report

Merging #4852 into master will not change coverage.
The diff coverage is 71.42%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #4852   +/-   ##
=======================================
  Coverage   59.25%   59.25%           
=======================================
  Files         200      200           
  Lines        6646     6646           
  Branches        4        4           
=======================================
  Hits         3938     3938           
  Misses       2708     2708
Impacted Files Coverage Δ
packages/pretty-format/src/plugins/immutable.js 100% <ø> (ø) ⬆️
packages/pretty-format/src/index.js 96.4% <ø> (ø) ⬆️
packages/jest-cli/src/get_no_test_found_verbose.js 0% <ø> (ø) ⬆️
packages/jest-circus/src/utils.js 0% <ø> (ø) ⬆️
packages/jest-resolve/src/index.js 97.34% <ø> (ø) ⬆️
packages/jest-config/src/normalize.js 92.68% <0%> (ø) ⬆️
packages/jest-haste-map/src/index.js 97.5% <100%> (ø) ⬆️
...ckages/jest-cli/src/reporters/coverage_reporter.js 55.55% <80%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6c4401d...0f206db. Read the comment docs.

implementation that may have been provided.

### `reporters` [array<moduleName | [moduleName,
options]>]
Copy link
Member Author

Choose a reason for hiding this comment

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

This looks wrong

{
// package.json
Copy link
Member Author

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?

{
"presets": ["es2015", "react"]
// .babelrc
Copy link
Member Author

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
Copy link
Member Author

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",
Copy link
Member Author

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
Copy link
Member Author

Choose a reason for hiding this comment

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

Ew...

Copy link
Member Author

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?

Copy link
Contributor

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.

Copy link
Member Author

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

| `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 |
Copy link
Member Author

Choose a reason for hiding this comment

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

❤️

@SimenB
Copy link
Member Author

SimenB commented Nov 7, 2017

I've found 2 bugs which I think should block the markdown part: prettier/prettier#3169 and prettier/prettier#3168

@SimenB
Copy link
Member Author

SimenB commented Nov 7, 2017

@cpojer I moved markdown to #4853, so this is now just JS-changes.

@cpojer cpojer merged commit 8901f87 into jestjs:master Nov 7, 2017
@@ -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.`,
Copy link
Member Author

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

Copy link
Contributor

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

Copy link
Member Author

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

@github-actions
Copy link

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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants