Bump Prettier (#12622)

This commit is contained in:
Dan Abramov 2018-04-17 01:43:55 +01:00 committed by GitHub
parent 77ebeb1b09
commit b05e67e36a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 25 additions and 43 deletions

View File

@ -79,7 +79,7 @@
"ncp": "^2.0.0",
"object-assign": "^4.1.1",
"platform": "^1.1.0",
"prettier": "1.8.1",
"prettier": "1.11.1",
"prop-types": "^15.6.0",
"random-seed": "^0.3.0",
"react-lifecycles-compat": "^1.0.2",

View File

@ -53,9 +53,7 @@ module.exports = function(initModules) {
console.error.calls.count() !== 0
) {
console.log(
`We expected ${
count
} warning(s), but saw ${console.error.calls.count()} warning(s).`,
`We expected ${count} warning(s), but saw ${console.error.calls.count()} warning(s).`,
);
if (console.error.calls.count() > 0) {
console.log(`We saw these warnings:`);
@ -237,9 +235,7 @@ module.exports = function(initModules) {
testFn(clientCleanRender));
it(`renders ${desc} with client render on top of good server markup`, () =>
testFn(clientRenderOnServerString));
it(`renders ${
desc
} with client render on top of bad server markup`, async () => {
it(`renders ${desc} with client render on top of bad server markup`, async () => {
try {
await testFn(clientRenderOnBadMarkup);
} catch (x) {

View File

@ -147,9 +147,7 @@ describe('SyntheticEvent', () => {
const getExpectedWarning = property =>
'Warning: This synthetic event is reused for performance reasons. If ' +
`you're seeing this, you're accessing the property \`${
property
}\` on a ` +
`you're seeing this, you're accessing the property \`${property}\` on a ` +
'released/nullified synthetic event. This is set to null. If you must ' +
'keep the original synthetic event around, use event.persist(). ' +
'See https://fb.me/react-event-pooling for more information.';

View File

@ -259,9 +259,7 @@ export function stopRequestCallbackTimer(
isWaitingForCallback = false;
const warning = didExpire ? 'React was blocked by main thread' : null;
endMark(
`(Waiting for async callback... will force flush in ${
expirationTime
} ms)`,
`(Waiting for async callback... will force flush in ${expirationTime} ms)`,
'(Waiting for async callback...)',
warning,
);
@ -385,9 +383,7 @@ export function stopWorkLoopTimer(
warning = 'A top-level update interrupted the previous render';
} else {
const componentName = getComponentName(interruptedBy) || 'Unknown';
warning = `An update to ${
componentName
} interrupted the previous render`;
warning = `An update to ${componentName} interrupted the previous render`;
}
} else if (commitCountInCurrentWorkLoop > 1) {
warning = 'There were cascading updates';

View File

@ -48,9 +48,7 @@ export function logCapturedError(capturedError: CapturedError): void {
`using the error boundary you provided, ${errorBoundaryName}.`;
} else {
errorBoundaryMessage =
`This error was initially handled by the error boundary ${
errorBoundaryName
}.\n` +
`This error was initially handled by the error boundary ${errorBoundaryName}.\n` +
`Recreating the tree from scratch failed so React will unmount the tree.`;
}
} else {

View File

@ -1123,9 +1123,7 @@ describe('ReactNewContext', () => {
expectedValues[key] = value;
} else if (value !== expectedValue) {
throw new Error(
`Inconsistent value! Expected: ${key}:${expectedValue}. Actual: ${
text
}`,
`Inconsistent value! Expected: ${key}:${expectedValue}. Actual: ${text}`,
);
}
});

View File

@ -30,9 +30,7 @@ export function showErrorDialog(capturedError: CapturedError): boolean {
errorToHandle = error;
try {
errorToHandle.message = `${summary}\n\nThis error is located at:${
componentStack
}`;
errorToHandle.message = `${summary}\n\nThis error is located at:${componentStack}`;
} catch (e) {}
} else if (typeof error === 'string') {
errorToHandle = new Error(

View File

@ -19,9 +19,9 @@ packages.forEach(name => {
// Root entry point
moduleNameMapper[`^${name}$`] = `<rootDir>/build/node_modules/${name}`;
// Named entry points
moduleNameMapper[`^${name}/(.*)$`] = `<rootDir>/build/node_modules/${
name
}/$1`;
moduleNameMapper[
`^${name}/(.*)$`
] = `<rootDir>/build/node_modules/${name}/$1`;
});
module.exports = Object.assign({}, sourceConfig, {

View File

@ -105,11 +105,11 @@ if (process.env.REACT_CLASS_EQUIVALENCE_TEST) {
`1. Using the ${chalk.bold('.toWarnDev()')} / ${chalk.bold(
'.toLowPriorityWarnDev()'
)} matchers, or...\n` +
`2. Mock it out using ${chalk.bold('spyOnDev')}(console, '${
methodName
}') or ${chalk.bold('spyOnProd')}(console, '${
methodName
}'), and test that the warning occurs.`;
`2. Mock it out using ${chalk.bold(
'spyOnDev'
)}(console, '${methodName}') or ${chalk.bold(
'spyOnProd'
)}(console, '${methodName}'), and test that the warning occurs.`;
throw new Error(`${message}\n\n${messages.join('\n\n')}`);
}

View File

@ -36,17 +36,13 @@ module.exports = ({cwd, dry, path, version}) => {
Here are a few things to keep in mind:
The changes should be easy to understand. (Friendly one-liners are better than PR titles.)
Make sure all contributors are credited.
Verify that the markup is valid by previewing it in the editor: {blue.bold ${
CHANGELOG_PATH
}}
Verify that the markup is valid by previewing it in the editor: {blue.bold ${CHANGELOG_PATH}}
{bold.underline Step 2: Smoke test the packages}
1. Open {yellow.bold ${standaloneFixturePath}} in the browser.
2. It should say {italic "Hello world!"}
3. Next go to {yellow.bold ${
packagingFixturesPath
}} and run {bold node build-all.js}
3. Next go to {yellow.bold ${packagingFixturesPath}} and run {bold node build-all.js}
4. Install the "serve" module ({bold npm install -g serve})
5. Go to the repo root and {bold serve -s .}
6. Open {blue.bold http://localhost:5000/fixtures/packaging}

View File

@ -49,9 +49,7 @@ const push = async ({cwd, dry, packages, version, tag}) => {
if (remoteVersion !== packageVersion) {
throw Error(
chalk`Published version {yellow.bold ${packageVersion}} for ` +
chalk`{bold ${project}} but NPM shows {yellow.bold ${
remoteVersion
}}`
chalk`{bold ${project}} but NPM shows {yellow.bold ${remoteVersion}}`
);
}

View File

@ -4293,7 +4293,11 @@ preserve@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
prettier@1.8.1, prettier@^1.0.0:
prettier@1.11.1:
version "1.11.1"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.11.1.tgz#61e43fc4cd44e68f2b0dfc2c38cd4bb0fccdcc75"
prettier@^1.0.0:
version "1.8.1"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.8.1.tgz#91064d778c08c85ac1cbe6b23195c34310d039f9"