diff --git a/package.json b/package.json index 34005687e5..86cff63303 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/packages/react-dom/src/__tests__/utils/ReactDOMServerIntegrationTestUtils.js b/packages/react-dom/src/__tests__/utils/ReactDOMServerIntegrationTestUtils.js index f24c2917df..b9cae59979 100644 --- a/packages/react-dom/src/__tests__/utils/ReactDOMServerIntegrationTestUtils.js +++ b/packages/react-dom/src/__tests__/utils/ReactDOMServerIntegrationTestUtils.js @@ -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) { diff --git a/packages/react-dom/src/events/__tests__/SyntheticEvent-test.js b/packages/react-dom/src/events/__tests__/SyntheticEvent-test.js index c0609e5fe2..e46ef77a49 100644 --- a/packages/react-dom/src/events/__tests__/SyntheticEvent-test.js +++ b/packages/react-dom/src/events/__tests__/SyntheticEvent-test.js @@ -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.'; diff --git a/packages/react-reconciler/src/ReactDebugFiberPerf.js b/packages/react-reconciler/src/ReactDebugFiberPerf.js index 0bd2dfb0ad..c2889986bf 100644 --- a/packages/react-reconciler/src/ReactDebugFiberPerf.js +++ b/packages/react-reconciler/src/ReactDebugFiberPerf.js @@ -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'; diff --git a/packages/react-reconciler/src/ReactFiberErrorLogger.js b/packages/react-reconciler/src/ReactFiberErrorLogger.js index 1a15878262..a5a4f756ab 100644 --- a/packages/react-reconciler/src/ReactFiberErrorLogger.js +++ b/packages/react-reconciler/src/ReactFiberErrorLogger.js @@ -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 { diff --git a/packages/react-reconciler/src/__tests__/ReactNewContext-test.internal.js b/packages/react-reconciler/src/__tests__/ReactNewContext-test.internal.js index 8784622b7f..0a4763a4fe 100644 --- a/packages/react-reconciler/src/__tests__/ReactNewContext-test.internal.js +++ b/packages/react-reconciler/src/__tests__/ReactNewContext-test.internal.js @@ -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}`, ); } }); diff --git a/packages/react-reconciler/src/forks/ReactFiberErrorDialog.native.js b/packages/react-reconciler/src/forks/ReactFiberErrorDialog.native.js index 357c21dddb..9c9a7decf8 100644 --- a/packages/react-reconciler/src/forks/ReactFiberErrorDialog.native.js +++ b/packages/react-reconciler/src/forks/ReactFiberErrorDialog.native.js @@ -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( diff --git a/scripts/jest/config.build.js b/scripts/jest/config.build.js index ba2aa3f3e1..c4e7444c92 100644 --- a/scripts/jest/config.build.js +++ b/scripts/jest/config.build.js @@ -19,9 +19,9 @@ packages.forEach(name => { // Root entry point moduleNameMapper[`^${name}$`] = `/build/node_modules/${name}`; // Named entry points - moduleNameMapper[`^${name}/(.*)$`] = `/build/node_modules/${ - name - }/$1`; + moduleNameMapper[ + `^${name}/(.*)$` + ] = `/build/node_modules/${name}/$1`; }); module.exports = Object.assign({}, sourceConfig, { diff --git a/scripts/jest/setupTests.js b/scripts/jest/setupTests.js index 40ccf4c8f5..bc09104a5d 100644 --- a/scripts/jest/setupTests.js +++ b/scripts/jest/setupTests.js @@ -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')}`); } diff --git a/scripts/release/build-commands/print-post-build-summary.js b/scripts/release/build-commands/print-post-build-summary.js index 60642cce11..a9c660d0c5 100644 --- a/scripts/release/build-commands/print-post-build-summary.js +++ b/scripts/release/build-commands/print-post-build-summary.js @@ -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} diff --git a/scripts/release/publish-commands/publish-to-npm.js b/scripts/release/publish-commands/publish-to-npm.js index 429b64cbd1..c573b2ccd1 100644 --- a/scripts/release/publish-commands/publish-to-npm.js +++ b/scripts/release/publish-commands/publish-to-npm.js @@ -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}}` ); } diff --git a/yarn.lock b/yarn.lock index f585a6c169..495fa024f6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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"