Skip to content

Commit 25f6a72

Browse files
viankakrisnathongdong7
authored andcommitted
Rerun prettier and pin version (facebook#3058)
* rerun prettier for all files * pin prettier to 1.6.1
1 parent 42f362c commit 25f6a72

34 files changed

+79
-133
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"lerna": "^2.0.0",
2020
"lerna-changelog": "^0.6.0",
2121
"lint-staged": "^3.3.1",
22-
"prettier": "^1.5.2"
22+
"prettier": "1.6.1"
2323
},
2424
"lint-staged": {
2525
"*.js": [

packages/create-react-app/createReactApp.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,9 @@ function checkNpmVersion() {
455455
let hasMinNpm = false;
456456
let npmVersion = null;
457457
try {
458-
npmVersion = execSync('npm --version').toString().trim();
458+
npmVersion = execSync('npm --version')
459+
.toString()
460+
.trim();
459461
hasMinNpm = semver.gte(npmVersion, '3.0.0');
460462
} catch (err) {
461463
// ignore

packages/react-dev-utils/launchEditor.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const COMMON_EDITORS_OSX = {
4343
'/Applications/CLion.app/Contents/MacOS/clion':
4444
'/Applications/CLion.app/Contents/MacOS/clion',
4545
'/Applications/IntelliJ IDEA.app/Contents/MacOS/idea':
46-
'/Applications/IntelliJ IDEA.app/Contents/MacOS/idea',
46+
'/Applications/IntelliJ IDEA.app/Contents/MacOS/idea',
4747
'/Applications/PhpStorm.app/Contents/MacOS/phpstorm':
4848
'/Applications/PhpStorm.app/Contents/MacOS/phpstorm',
4949
'/Applications/PyCharm.app/Contents/MacOS/pycharm':
@@ -53,7 +53,7 @@ const COMMON_EDITORS_OSX = {
5353
'/Applications/RubyMine.app/Contents/MacOS/rubymine':
5454
'/Applications/RubyMine.app/Contents/MacOS/rubymine',
5555
'/Applications/WebStorm.app/Contents/MacOS/webstorm':
56-
'/Applications/WebStorm.app/Contents/MacOS/webstorm',
56+
'/Applications/WebStorm.app/Contents/MacOS/webstorm',
5757
};
5858

5959
const COMMON_EDITORS_WIN = [

packages/react-error-overlay/src/components/Header.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@ type HeaderPropType = {|
2929
|};
3030

3131
function Header(props: HeaderPropType) {
32-
return (
33-
<div style={headerStyle}>
34-
{props.headerText}
35-
</div>
36-
);
32+
return <div style={headerStyle}>{props.headerText}</div>;
3733
}
3834

3935
export default Header;

packages/react-error-overlay/src/containers/RuntimeErrorContainer.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,14 @@ class RuntimeErrorContainer extends PureComponent {
5454
return (
5555
<ErrorOverlay shortcutHandler={this.shortcutHandler}>
5656
<CloseButton close={close} />
57-
{totalErrors > 1 &&
57+
{totalErrors > 1 && (
5858
<NavigationBar
5959
currentError={this.state.currentIndex + 1}
6060
totalErrors={totalErrors}
6161
previous={this.previous}
6262
next={this.next}
63-
/>}
63+
/>
64+
)}
6465
<RuntimeError
6566
errorRecord={errorRecords[this.state.currentIndex]}
6667
launchEditorEndpoint={this.props.launchEditorEndpoint}

packages/react-error-overlay/src/containers/StackFrame.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,7 @@ class StackFrame extends Component {
155155
const canOpenInEditor = this.canOpenInEditor();
156156
return (
157157
<div>
158-
<div>
159-
{functionName}
160-
</div>
158+
<div>{functionName}</div>
161159
<div style={linkStyle}>
162160
<a
163161
style={canOpenInEditor ? anchorStyle : null}
@@ -168,7 +166,7 @@ class StackFrame extends Component {
168166
{url}
169167
</a>
170168
</div>
171-
{codeBlockProps &&
169+
{codeBlockProps && (
172170
<span>
173171
<a
174172
onClick={canOpenInEditor ? this.openInEditor : null}
@@ -179,7 +177,8 @@ class StackFrame extends Component {
179177
<button style={toggleStyle} onClick={this.toggleCompiled}>
180178
{'View ' + (compiled ? 'source' : 'compiled')}
181179
</button>
182-
</span>}
180+
</span>
181+
)}
183182
</div>
184183
);
185184
}

packages/react-error-overlay/src/containers/StackTrace.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,7 @@ class StackTrace extends Component {
8484
}
8585

8686
render() {
87-
return (
88-
<div style={traceStyle}>
89-
{this.renderFrames()}
90-
</div>
91-
);
87+
return <div style={traceStyle}>{this.renderFrames()}</div>;
9288
}
9389
}
9490

packages/react-error-overlay/src/utils/parser.js

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,16 @@ import StackFrame from './stack-frame';
1313
const regexExtractLocation = /\(?(.+?)(?::(\d+))?(?::(\d+))?\)?$/;
1414

1515
function extractLocation(token: string): [string, number, number] {
16-
return regexExtractLocation.exec(token).slice(1).map(v => {
17-
const p = Number(v);
18-
if (!isNaN(p)) {
19-
return p;
20-
}
21-
return v;
22-
});
16+
return regexExtractLocation
17+
.exec(token)
18+
.slice(1)
19+
.map(v => {
20+
const p = Number(v);
21+
if (!isNaN(p)) {
22+
return p;
23+
}
24+
return v;
25+
});
2326
}
2427

2528
const regexValidFrame_Chrome = /^\s*(at|in)\s.+(:\d+)/;
@@ -55,7 +58,10 @@ function parseStack(stack: string[]): StackFrame[] {
5558
if (e.indexOf('(at ') !== -1) {
5659
e = e.replace(/\(at /, '(');
5760
}
58-
const data = e.trim().split(/\s+/g).slice(1);
61+
const data = e
62+
.trim()
63+
.split(/\s+/g)
64+
.slice(1);
5965
const last = data.pop();
6066
return new StackFrame(data.join(' ') || null, ...extractLocation(last));
6167
}

packages/react-error-overlay/src/utils/warnings.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
import type { ReactFrame } from '../effects/proxyConsole';
1212

1313
function stripInlineStacktrace(message: string): string {
14-
return message.split('\n').filter(line => !line.match(/^\s*in/)).join('\n'); // " in Foo"
14+
return message
15+
.split('\n')
16+
.filter(line => !line.match(/^\s*in/))
17+
.join('\n'); // " in Foo"
1518
}
1619

1720
function massage(

packages/react-scripts/fixtures/kitchensink/src/features/env/FileEnvVariables.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import React from 'react';
1111

12-
export default () =>
12+
export default () => (
1313
<span>
1414
<span id="feature-file-env-original-1">
1515
{process.env.REACT_APP_ORIGINAL_1}
@@ -21,7 +21,6 @@ export default () =>
2121
{process.env.REACT_APP_DEVELOPMENT}
2222
{process.env.REACT_APP_PRODUCTION}
2323
</span>
24-
<span id="feature-file-env-x">
25-
{process.env.REACT_APP_X}
26-
</span>
27-
</span>;
24+
<span id="feature-file-env-x">{process.env.REACT_APP_X}</span>
25+
</span>
26+
);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy