diff --git a/package.json b/package.json index c3dd6404b5e..5758c6263af 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "lerna": "^2.0.0", "lerna-changelog": "^0.6.0", "lint-staged": "^3.3.1", - "prettier": "^1.5.2" + "prettier": "1.6.1" }, "lint-staged": { "*.js": [ diff --git a/packages/create-react-app/createReactApp.js b/packages/create-react-app/createReactApp.js index 4a1b7901dc4..594f811549e 100755 --- a/packages/create-react-app/createReactApp.js +++ b/packages/create-react-app/createReactApp.js @@ -455,7 +455,9 @@ function checkNpmVersion() { let hasMinNpm = false; let npmVersion = null; try { - npmVersion = execSync('npm --version').toString().trim(); + npmVersion = execSync('npm --version') + .toString() + .trim(); hasMinNpm = semver.gte(npmVersion, '3.0.0'); } catch (err) { // ignore diff --git a/packages/react-dev-utils/launchEditor.js b/packages/react-dev-utils/launchEditor.js index e1ea29c8869..95ae1cddf65 100644 --- a/packages/react-dev-utils/launchEditor.js +++ b/packages/react-dev-utils/launchEditor.js @@ -43,7 +43,7 @@ const COMMON_EDITORS_OSX = { '/Applications/CLion.app/Contents/MacOS/clion': '/Applications/CLion.app/Contents/MacOS/clion', '/Applications/IntelliJ IDEA.app/Contents/MacOS/idea': - '/Applications/IntelliJ IDEA.app/Contents/MacOS/idea', + '/Applications/IntelliJ IDEA.app/Contents/MacOS/idea', '/Applications/PhpStorm.app/Contents/MacOS/phpstorm': '/Applications/PhpStorm.app/Contents/MacOS/phpstorm', '/Applications/PyCharm.app/Contents/MacOS/pycharm': @@ -53,7 +53,7 @@ const COMMON_EDITORS_OSX = { '/Applications/RubyMine.app/Contents/MacOS/rubymine': '/Applications/RubyMine.app/Contents/MacOS/rubymine', '/Applications/WebStorm.app/Contents/MacOS/webstorm': - '/Applications/WebStorm.app/Contents/MacOS/webstorm', + '/Applications/WebStorm.app/Contents/MacOS/webstorm', }; const COMMON_EDITORS_WIN = [ diff --git a/packages/react-error-overlay/src/components/Header.js b/packages/react-error-overlay/src/components/Header.js index a2f40973d00..22716234332 100644 --- a/packages/react-error-overlay/src/components/Header.js +++ b/packages/react-error-overlay/src/components/Header.js @@ -29,11 +29,7 @@ type HeaderPropType = {| |}; function Header(props: HeaderPropType) { - return ( -
- {props.headerText} -
- ); + return
{props.headerText}
; } export default Header; diff --git a/packages/react-error-overlay/src/containers/RuntimeErrorContainer.js b/packages/react-error-overlay/src/containers/RuntimeErrorContainer.js index 9c41aa38109..1e09724df9a 100644 --- a/packages/react-error-overlay/src/containers/RuntimeErrorContainer.js +++ b/packages/react-error-overlay/src/containers/RuntimeErrorContainer.js @@ -54,13 +54,14 @@ class RuntimeErrorContainer extends PureComponent { return ( - {totalErrors > 1 && + {totalErrors > 1 && ( } + /> + )} -
- {functionName} -
+
{functionName}
- {codeBlockProps && + {codeBlockProps && ( {'View ' + (compiled ? 'source' : 'compiled')} - } + + )} ); } diff --git a/packages/react-error-overlay/src/containers/StackTrace.js b/packages/react-error-overlay/src/containers/StackTrace.js index 4cb20bce128..8d81cc9429e 100644 --- a/packages/react-error-overlay/src/containers/StackTrace.js +++ b/packages/react-error-overlay/src/containers/StackTrace.js @@ -84,11 +84,7 @@ class StackTrace extends Component { } render() { - return ( -
- {this.renderFrames()} -
- ); + return
{this.renderFrames()}
; } } diff --git a/packages/react-error-overlay/src/utils/parser.js b/packages/react-error-overlay/src/utils/parser.js index 1cbee1d1ccc..6bc65ed8de2 100644 --- a/packages/react-error-overlay/src/utils/parser.js +++ b/packages/react-error-overlay/src/utils/parser.js @@ -13,13 +13,16 @@ import StackFrame from './stack-frame'; const regexExtractLocation = /\(?(.+?)(?::(\d+))?(?::(\d+))?\)?$/; function extractLocation(token: string): [string, number, number] { - return regexExtractLocation.exec(token).slice(1).map(v => { - const p = Number(v); - if (!isNaN(p)) { - return p; - } - return v; - }); + return regexExtractLocation + .exec(token) + .slice(1) + .map(v => { + const p = Number(v); + if (!isNaN(p)) { + return p; + } + return v; + }); } const regexValidFrame_Chrome = /^\s*(at|in)\s.+(:\d+)/; @@ -55,7 +58,10 @@ function parseStack(stack: string[]): StackFrame[] { if (e.indexOf('(at ') !== -1) { e = e.replace(/\(at /, '('); } - const data = e.trim().split(/\s+/g).slice(1); + const data = e + .trim() + .split(/\s+/g) + .slice(1); const last = data.pop(); return new StackFrame(data.join(' ') || null, ...extractLocation(last)); } diff --git a/packages/react-error-overlay/src/utils/warnings.js b/packages/react-error-overlay/src/utils/warnings.js index bcc54ceb733..1cdb53dc063 100644 --- a/packages/react-error-overlay/src/utils/warnings.js +++ b/packages/react-error-overlay/src/utils/warnings.js @@ -11,7 +11,10 @@ import type { ReactFrame } from '../effects/proxyConsole'; function stripInlineStacktrace(message: string): string { - return message.split('\n').filter(line => !line.match(/^\s*in/)).join('\n'); // " in Foo" + return message + .split('\n') + .filter(line => !line.match(/^\s*in/)) + .join('\n'); // " in Foo" } function massage( diff --git a/packages/react-scripts/fixtures/kitchensink/src/features/env/FileEnvVariables.js b/packages/react-scripts/fixtures/kitchensink/src/features/env/FileEnvVariables.js index 03d6384719e..41c472e032c 100644 --- a/packages/react-scripts/fixtures/kitchensink/src/features/env/FileEnvVariables.js +++ b/packages/react-scripts/fixtures/kitchensink/src/features/env/FileEnvVariables.js @@ -9,7 +9,7 @@ import React from 'react'; -export default () => +export default () => ( {process.env.REACT_APP_ORIGINAL_1} @@ -21,7 +21,6 @@ export default () => {process.env.REACT_APP_DEVELOPMENT} {process.env.REACT_APP_PRODUCTION} - - {process.env.REACT_APP_X} - - ; + {process.env.REACT_APP_X} + +); diff --git a/packages/react-scripts/fixtures/kitchensink/src/features/env/NodePath.js b/packages/react-scripts/fixtures/kitchensink/src/features/env/NodePath.js index 6d2437a641f..a039cefedf3 100644 --- a/packages/react-scripts/fixtures/kitchensink/src/features/env/NodePath.js +++ b/packages/react-scripts/fixtures/kitchensink/src/features/env/NodePath.js @@ -33,11 +33,7 @@ export default class extends Component { render() { return (
- {this.state.users.map(user => -
- {user.name} -
- )} + {this.state.users.map(user =>
{user.name}
)}
); } diff --git a/packages/react-scripts/fixtures/kitchensink/src/features/env/PublicUrl.js b/packages/react-scripts/fixtures/kitchensink/src/features/env/PublicUrl.js index af87748e63e..4ea9b96f8b2 100644 --- a/packages/react-scripts/fixtures/kitchensink/src/features/env/PublicUrl.js +++ b/packages/react-scripts/fixtures/kitchensink/src/features/env/PublicUrl.js @@ -9,7 +9,6 @@ import React from 'react'; -export default () => - - {process.env.PUBLIC_URL}. - ; +export default () => ( + {process.env.PUBLIC_URL}. +); diff --git a/packages/react-scripts/fixtures/kitchensink/src/features/env/ShellEnvVariables.js b/packages/react-scripts/fixtures/kitchensink/src/features/env/ShellEnvVariables.js index 400dfc013be..8449097d69a 100644 --- a/packages/react-scripts/fixtures/kitchensink/src/features/env/ShellEnvVariables.js +++ b/packages/react-scripts/fixtures/kitchensink/src/features/env/ShellEnvVariables.js @@ -9,7 +9,8 @@ import React from 'react'; -export default () => +export default () => ( {process.env.REACT_APP_SHELL_ENV_MESSAGE}. - ; + +); diff --git a/packages/react-scripts/fixtures/kitchensink/src/features/syntax/ArrayDestructuring.js b/packages/react-scripts/fixtures/kitchensink/src/features/syntax/ArrayDestructuring.js index de0576549c5..be6c39f9007 100644 --- a/packages/react-scripts/fixtures/kitchensink/src/features/syntax/ArrayDestructuring.js +++ b/packages/react-scripts/fixtures/kitchensink/src/features/syntax/ArrayDestructuring.js @@ -38,11 +38,7 @@ export default class extends Component {
{this.state.users.map(user => { const [id, name] = user; - return ( -
- {name} -
- ); + return
{name}
; })}
); diff --git a/packages/react-scripts/fixtures/kitchensink/src/features/syntax/ArraySpread.js b/packages/react-scripts/fixtures/kitchensink/src/features/syntax/ArraySpread.js index ebf90ef6ed8..eb7886aa47b 100644 --- a/packages/react-scripts/fixtures/kitchensink/src/features/syntax/ArraySpread.js +++ b/packages/react-scripts/fixtures/kitchensink/src/features/syntax/ArraySpread.js @@ -41,11 +41,7 @@ export default class extends Component { render() { return (
- {this.state.users.map(user => -
- {user.name} -
- )} + {this.state.users.map(user =>
{user.name}
)}
); } diff --git a/packages/react-scripts/fixtures/kitchensink/src/features/syntax/AsyncAwait.js b/packages/react-scripts/fixtures/kitchensink/src/features/syntax/AsyncAwait.js index c91da311da6..a60633460b3 100644 --- a/packages/react-scripts/fixtures/kitchensink/src/features/syntax/AsyncAwait.js +++ b/packages/react-scripts/fixtures/kitchensink/src/features/syntax/AsyncAwait.js @@ -41,11 +41,7 @@ export default class extends Component { render() { return (
- {this.state.users.map(user => -
- {user.name} -
- )} + {this.state.users.map(user =>
{user.name}
)}
); } diff --git a/packages/react-scripts/fixtures/kitchensink/src/features/syntax/ClassProperties.js b/packages/react-scripts/fixtures/kitchensink/src/features/syntax/ClassProperties.js index 58ae10763dc..ed96d4f8c9e 100644 --- a/packages/react-scripts/fixtures/kitchensink/src/features/syntax/ClassProperties.js +++ b/packages/react-scripts/fixtures/kitchensink/src/features/syntax/ClassProperties.js @@ -29,11 +29,7 @@ export default class extends Component { render() { return (
- {this.users.map(user => -
- {user.name} -
- )} + {this.users.map(user =>
{user.name}
)}
); } diff --git a/packages/react-scripts/fixtures/kitchensink/src/features/syntax/ComputedProperties.js b/packages/react-scripts/fixtures/kitchensink/src/features/syntax/ComputedProperties.js index fcbf721e88b..38dc797a8d5 100644 --- a/packages/react-scripts/fixtures/kitchensink/src/features/syntax/ComputedProperties.js +++ b/packages/react-scripts/fixtures/kitchensink/src/features/syntax/ComputedProperties.js @@ -41,11 +41,9 @@ export default class extends Component { render() { return (
- {this.state.users.map(user => -
- {user.user_name} -
- )} + {this.state.users.map(user => ( +
{user.user_name}
+ ))}
); } diff --git a/packages/react-scripts/fixtures/kitchensink/src/features/syntax/CustomInterpolation.js b/packages/react-scripts/fixtures/kitchensink/src/features/syntax/CustomInterpolation.js index ab648255a8d..a6c9b69de5e 100644 --- a/packages/react-scripts/fixtures/kitchensink/src/features/syntax/CustomInterpolation.js +++ b/packages/react-scripts/fixtures/kitchensink/src/features/syntax/CustomInterpolation.js @@ -53,11 +53,11 @@ export default class extends Component { return (
- {this.state.users.map(user => + {this.state.users.map(user => (
{user.name}
- )} + ))}
); } diff --git a/packages/react-scripts/fixtures/kitchensink/src/features/syntax/DefaultParameters.js b/packages/react-scripts/fixtures/kitchensink/src/features/syntax/DefaultParameters.js index 6ebabaec7ea..0a519eba839 100644 --- a/packages/react-scripts/fixtures/kitchensink/src/features/syntax/DefaultParameters.js +++ b/packages/react-scripts/fixtures/kitchensink/src/features/syntax/DefaultParameters.js @@ -41,11 +41,7 @@ export default class extends Component { render() { return (
- {this.state.users.map(user => -
- {user.name} -
- )} + {this.state.users.map(user =>
{user.name}
)}
); } diff --git a/packages/react-scripts/fixtures/kitchensink/src/features/syntax/DestructuringAndAwait.js b/packages/react-scripts/fixtures/kitchensink/src/features/syntax/DestructuringAndAwait.js index aa8c9d7db79..d44f4cf222c 100644 --- a/packages/react-scripts/fixtures/kitchensink/src/features/syntax/DestructuringAndAwait.js +++ b/packages/react-scripts/fixtures/kitchensink/src/features/syntax/DestructuringAndAwait.js @@ -43,11 +43,7 @@ export default class extends Component { render() { return (
- {this.state.users.map(user => -
- {user.name} -
- )} + {this.state.users.map(user =>
{user.name}
)}
); } diff --git a/packages/react-scripts/fixtures/kitchensink/src/features/syntax/Generators.js b/packages/react-scripts/fixtures/kitchensink/src/features/syntax/Generators.js index 44b2776e1f3..2fe473d1339 100644 --- a/packages/react-scripts/fixtures/kitchensink/src/features/syntax/Generators.js +++ b/packages/react-scripts/fixtures/kitchensink/src/features/syntax/Generators.js @@ -43,11 +43,7 @@ export default class extends Component { render() { return (
- {this.state.users.map(user => -
- {user.name} -
- )} + {this.state.users.map(user =>
{user.name}
)}
); } diff --git a/packages/react-scripts/fixtures/kitchensink/src/features/syntax/ObjectDestructuring.js b/packages/react-scripts/fixtures/kitchensink/src/features/syntax/ObjectDestructuring.js index 8a7b1095f10..2994d14af4d 100644 --- a/packages/react-scripts/fixtures/kitchensink/src/features/syntax/ObjectDestructuring.js +++ b/packages/react-scripts/fixtures/kitchensink/src/features/syntax/ObjectDestructuring.js @@ -43,11 +43,7 @@ export default class extends Component {
{this.state.users.map(user => { const { id, name } = user; - return ( -
- {name} -
- ); + return
{name}
; })}
); diff --git a/packages/react-scripts/fixtures/kitchensink/src/features/syntax/ObjectSpread.js b/packages/react-scripts/fixtures/kitchensink/src/features/syntax/ObjectSpread.js index 5ff4e10ac75..7349be2f9e4 100644 --- a/packages/react-scripts/fixtures/kitchensink/src/features/syntax/ObjectSpread.js +++ b/packages/react-scripts/fixtures/kitchensink/src/features/syntax/ObjectSpread.js @@ -41,11 +41,11 @@ export default class extends Component { render() { return (
- {this.state.users.map(user => + {this.state.users.map(user => (
{user.name}: {user.age}
- )} + ))}
); } diff --git a/packages/react-scripts/fixtures/kitchensink/src/features/syntax/Promises.js b/packages/react-scripts/fixtures/kitchensink/src/features/syntax/Promises.js index 31ef2c9ebb8..e626de5d818 100644 --- a/packages/react-scripts/fixtures/kitchensink/src/features/syntax/Promises.js +++ b/packages/react-scripts/fixtures/kitchensink/src/features/syntax/Promises.js @@ -42,11 +42,7 @@ export default class extends Component { render() { return (
- {this.state.users.map(user => -
- {user.name} -
- )} + {this.state.users.map(user =>
{user.name}
)}
); } diff --git a/packages/react-scripts/fixtures/kitchensink/src/features/syntax/RestAndDefault.js b/packages/react-scripts/fixtures/kitchensink/src/features/syntax/RestAndDefault.js index 9e3e3fbabc4..dc2a1563a41 100644 --- a/packages/react-scripts/fixtures/kitchensink/src/features/syntax/RestAndDefault.js +++ b/packages/react-scripts/fixtures/kitchensink/src/features/syntax/RestAndDefault.js @@ -41,11 +41,7 @@ export default class extends Component { render() { return (
- {this.state.users.map(user => -
- {user.name} -
- )} + {this.state.users.map(user =>
{user.name}
)}
); } diff --git a/packages/react-scripts/fixtures/kitchensink/src/features/syntax/RestParameters.js b/packages/react-scripts/fixtures/kitchensink/src/features/syntax/RestParameters.js index 98a0e7edc44..e703a33cc86 100644 --- a/packages/react-scripts/fixtures/kitchensink/src/features/syntax/RestParameters.js +++ b/packages/react-scripts/fixtures/kitchensink/src/features/syntax/RestParameters.js @@ -41,11 +41,7 @@ export default class extends Component { render() { return (
- {this.state.users.map(user => -
- {user.name} -
- )} + {this.state.users.map(user =>
{user.name}
)}
); } diff --git a/packages/react-scripts/fixtures/kitchensink/src/features/syntax/TemplateInterpolation.js b/packages/react-scripts/fixtures/kitchensink/src/features/syntax/TemplateInterpolation.js index b69f7ede8bd..5aba5da6272 100644 --- a/packages/react-scripts/fixtures/kitchensink/src/features/syntax/TemplateInterpolation.js +++ b/packages/react-scripts/fixtures/kitchensink/src/features/syntax/TemplateInterpolation.js @@ -41,11 +41,7 @@ export default class extends Component { render() { return (
- {this.state.users.map(user => -
- {user.name} -
- )} + {this.state.users.map(user =>
{user.name}
)}
); } diff --git a/packages/react-scripts/fixtures/kitchensink/src/features/webpack/ImageInclusion.js b/packages/react-scripts/fixtures/kitchensink/src/features/webpack/ImageInclusion.js index 8598d8d067d..a6ca7aaa818 100644 --- a/packages/react-scripts/fixtures/kitchensink/src/features/webpack/ImageInclusion.js +++ b/packages/react-scripts/fixtures/kitchensink/src/features/webpack/ImageInclusion.js @@ -10,5 +10,6 @@ import React from 'react'; import tiniestCat from './assets/tiniest-cat.jpg'; -export default () => - tiniest cat; +export default () => ( + tiniest cat +); diff --git a/packages/react-scripts/fixtures/kitchensink/src/features/webpack/JsonInclusion.js b/packages/react-scripts/fixtures/kitchensink/src/features/webpack/JsonInclusion.js index 66425c66c74..e81f7639736 100644 --- a/packages/react-scripts/fixtures/kitchensink/src/features/webpack/JsonInclusion.js +++ b/packages/react-scripts/fixtures/kitchensink/src/features/webpack/JsonInclusion.js @@ -10,7 +10,4 @@ import React from 'react'; import { abstract } from './assets/abstract.json'; -export default () => - - {abstract} - ; +export default () => {abstract}; diff --git a/packages/react-scripts/fixtures/kitchensink/src/features/webpack/LinkedModules.js b/packages/react-scripts/fixtures/kitchensink/src/features/webpack/LinkedModules.js index 395ebd7ed50..de8a5e4ab5b 100644 --- a/packages/react-scripts/fixtures/kitchensink/src/features/webpack/LinkedModules.js +++ b/packages/react-scripts/fixtures/kitchensink/src/features/webpack/LinkedModules.js @@ -16,9 +16,5 @@ export default () => { if (!test() || v !== '2.0.0') { throw new Error('Functionality test did not pass.'); } - return ( -

- {v} -

- ); + return

{v}

; }; diff --git a/packages/react-scripts/fixtures/kitchensink/src/features/webpack/NoExtInclusion.js b/packages/react-scripts/fixtures/kitchensink/src/features/webpack/NoExtInclusion.js index 086885db2d4..be22a6c9fe1 100644 --- a/packages/react-scripts/fixtures/kitchensink/src/features/webpack/NoExtInclusion.js +++ b/packages/react-scripts/fixtures/kitchensink/src/features/webpack/NoExtInclusion.js @@ -14,7 +14,8 @@ const text = aFileWithoutExt.includes('base64') ? atob(aFileWithoutExt.split('base64,')[1]).trim() : aFileWithoutExt; -export default () => +export default () => (
aFileWithoutExt - ; + +); diff --git a/packages/react-scripts/fixtures/kitchensink/src/features/webpack/UnknownExtInclusion.js b/packages/react-scripts/fixtures/kitchensink/src/features/webpack/UnknownExtInclusion.js index c41a1e0c024..5cae4516a3d 100644 --- a/packages/react-scripts/fixtures/kitchensink/src/features/webpack/UnknownExtInclusion.js +++ b/packages/react-scripts/fixtures/kitchensink/src/features/webpack/UnknownExtInclusion.js @@ -14,7 +14,8 @@ const text = aFileWithExtUnknown.includes('base64') ? atob(aFileWithExtUnknown.split('base64,')[1]).trim() : aFileWithExtUnknown; -export default () => +export default () => ( aFileWithExtUnknown - ; + +); diff --git a/packages/react-scripts/scripts/eject.js b/packages/react-scripts/scripts/eject.js index 3d8d258cc67..8f6af4f4721 100644 --- a/packages/react-scripts/scripts/eject.js +++ b/packages/react-scripts/scripts/eject.js @@ -167,9 +167,11 @@ inquirer // Sort the deps const unsortedDependencies = appPackage.dependencies; appPackage.dependencies = {}; - Object.keys(unsortedDependencies).sort().forEach(key => { - appPackage.dependencies[key] = unsortedDependencies[key]; - }); + Object.keys(unsortedDependencies) + .sort() + .forEach(key => { + appPackage.dependencies[key] = unsortedDependencies[key]; + }); console.log(); console.log(cyan('Updating the scripts'));