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", "ncp": "^2.0.0",
"object-assign": "^4.1.1", "object-assign": "^4.1.1",
"platform": "^1.1.0", "platform": "^1.1.0",
"prettier": "1.8.1", "prettier": "1.11.1",
"prop-types": "^15.6.0", "prop-types": "^15.6.0",
"random-seed": "^0.3.0", "random-seed": "^0.3.0",
"react-lifecycles-compat": "^1.0.2", "react-lifecycles-compat": "^1.0.2",

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -19,9 +19,9 @@ packages.forEach(name => {
// Root entry point // Root entry point
moduleNameMapper[`^${name}$`] = `<rootDir>/build/node_modules/${name}`; moduleNameMapper[`^${name}$`] = `<rootDir>/build/node_modules/${name}`;
// Named entry points // Named entry points
moduleNameMapper[`^${name}/(.*)$`] = `<rootDir>/build/node_modules/${ moduleNameMapper[
name `^${name}/(.*)$`
}/$1`; ] = `<rootDir>/build/node_modules/${name}/$1`;
}); });
module.exports = Object.assign({}, sourceConfig, { 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( `1. Using the ${chalk.bold('.toWarnDev()')} / ${chalk.bold(
'.toLowPriorityWarnDev()' '.toLowPriorityWarnDev()'
)} matchers, or...\n` + )} matchers, or...\n` +
`2. Mock it out using ${chalk.bold('spyOnDev')}(console, '${ `2. Mock it out using ${chalk.bold(
methodName 'spyOnDev'
}') or ${chalk.bold('spyOnProd')}(console, '${ )}(console, '${methodName}') or ${chalk.bold(
methodName 'spyOnProd'
}'), and test that the warning occurs.`; )}(console, '${methodName}'), and test that the warning occurs.`;
throw new Error(`${message}\n\n${messages.join('\n\n')}`); 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: Here are a few things to keep in mind:
The changes should be easy to understand. (Friendly one-liners are better than PR titles.) The changes should be easy to understand. (Friendly one-liners are better than PR titles.)
Make sure all contributors are credited. Make sure all contributors are credited.
Verify that the markup is valid by previewing it in the editor: {blue.bold ${ Verify that the markup is valid by previewing it in the editor: {blue.bold ${CHANGELOG_PATH}}
CHANGELOG_PATH
}}
{bold.underline Step 2: Smoke test the packages} {bold.underline Step 2: Smoke test the packages}
1. Open {yellow.bold ${standaloneFixturePath}} in the browser. 1. Open {yellow.bold ${standaloneFixturePath}} in the browser.
2. It should say {italic "Hello world!"} 2. It should say {italic "Hello world!"}
3. Next go to {yellow.bold ${ 3. Next go to {yellow.bold ${packagingFixturesPath}} and run {bold node build-all.js}
packagingFixturesPath
}} and run {bold node build-all.js}
4. Install the "serve" module ({bold npm install -g serve}) 4. Install the "serve" module ({bold npm install -g serve})
5. Go to the repo root and {bold serve -s .} 5. Go to the repo root and {bold serve -s .}
6. Open {blue.bold http://localhost:5000/fixtures/packaging} 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) { if (remoteVersion !== packageVersion) {
throw Error( throw Error(
chalk`Published version {yellow.bold ${packageVersion}} for ` + chalk`Published version {yellow.bold ${packageVersion}} for ` +
chalk`{bold ${project}} but NPM shows {yellow.bold ${ chalk`{bold ${project}} but NPM shows {yellow.bold ${remoteVersion}}`
remoteVersion
}}`
); );
} }

View File

@ -4293,7 +4293,11 @@ preserve@^0.2.0:
version "0.2.0" version "0.2.0"
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" 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" version "1.8.1"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.8.1.tgz#91064d778c08c85ac1cbe6b23195c34310d039f9" resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.8.1.tgz#91064d778c08c85ac1cbe6b23195c34310d039f9"