Commit 44cfbccf authored by Ade Viankakrisna Fadlil's avatar Ade Viankakrisna Fadlil Committed by Joe Haddad
Browse files

Rerun prettier and pin version (#3058)

* rerun prettier for all files

* pin prettier to 1.6.1
parent 5e300ceb
Showing with 54 additions and 78 deletions
+54 -78
......@@ -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": [
......
......@@ -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
......
......@@ -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 = [
......
......@@ -29,11 +29,7 @@ type HeaderPropType = {|
|};
function Header(props: HeaderPropType) {
return (
<div style={headerStyle}>
{props.headerText}
</div>
);
return <div style={headerStyle}>{props.headerText}</div>;
}
export default Header;
......@@ -54,13 +54,14 @@ class RuntimeErrorContainer extends PureComponent {
return (
<ErrorOverlay shortcutHandler={this.shortcutHandler}>
<CloseButton close={close} />
{totalErrors > 1 &&
{totalErrors > 1 && (
<NavigationBar
currentError={this.state.currentIndex + 1}
totalErrors={totalErrors}
previous={this.previous}
next={this.next}
/>}
/>
)}
<RuntimeError
errorRecord={errorRecords[this.state.currentIndex]}
launchEditorEndpoint={this.props.launchEditorEndpoint}
......
......@@ -155,9 +155,7 @@ class StackFrame extends Component {
const canOpenInEditor = this.canOpenInEditor();
return (
<div>
<div>
{functionName}
</div>
<div>{functionName}</div>
<div style={linkStyle}>
<a
style={canOpenInEditor ? anchorStyle : null}
......@@ -168,7 +166,7 @@ class StackFrame extends Component {
{url}
</a>
</div>
{codeBlockProps &&
{codeBlockProps && (
<span>
<a
onClick={canOpenInEditor ? this.openInEditor : null}
......@@ -179,7 +177,8 @@ class StackFrame extends Component {
<button style={toggleStyle} onClick={this.toggleCompiled}>
{'View ' + (compiled ? 'source' : 'compiled')}
</button>
</span>}
</span>
)}
</div>
);
}
......
......@@ -84,11 +84,7 @@ class StackTrace extends Component {
}
render() {
return (
<div style={traceStyle}>
{this.renderFrames()}
</div>
);
return <div style={traceStyle}>{this.renderFrames()}</div>;
}
}
......
......@@ -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));
}
......
......@@ -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(
......
......@@ -9,7 +9,7 @@
import React from 'react';
export default () =>
export default () => (
<span>
<span id="feature-file-env-original-1">
{process.env.REACT_APP_ORIGINAL_1}
......@@ -21,7 +21,6 @@ export default () =>
{process.env.REACT_APP_DEVELOPMENT}
{process.env.REACT_APP_PRODUCTION}
</span>
<span id="feature-file-env-x">
{process.env.REACT_APP_X}
</span>
</span>;
<span id="feature-file-env-x">{process.env.REACT_APP_X}</span>
</span>
);
......@@ -33,11 +33,7 @@ export default class extends Component {
render() {
return (
<div id="feature-node-path">
{this.state.users.map(user =>
<div key={user.id}>
{user.name}
</div>
)}
{this.state.users.map(user => <div key={user.id}>{user.name}</div>)}
</div>
);
}
......
......@@ -9,7 +9,6 @@
import React from 'react';
export default () =>
<span id="feature-public-url">
{process.env.PUBLIC_URL}.
</span>;
export default () => (
<span id="feature-public-url">{process.env.PUBLIC_URL}.</span>
);
......@@ -9,7 +9,8 @@
import React from 'react';
export default () =>
export default () => (
<span id="feature-shell-env-variables">
{process.env.REACT_APP_SHELL_ENV_MESSAGE}.
</span>;
</span>
);
......@@ -38,11 +38,7 @@ export default class extends Component {
<div id="feature-array-destructuring">
{this.state.users.map(user => {
const [id, name] = user;
return (
<div key={id}>
{name}
</div>
);
return <div key={id}>{name}</div>;
})}
</div>
);
......
......@@ -41,11 +41,7 @@ export default class extends Component {
render() {
return (
<div id="feature-array-spread">
{this.state.users.map(user =>
<div key={user.id}>
{user.name}
</div>
)}
{this.state.users.map(user => <div key={user.id}>{user.name}</div>)}
</div>
);
}
......
......@@ -41,11 +41,7 @@ export default class extends Component {
render() {
return (
<div id="feature-async-await">
{this.state.users.map(user =>
<div key={user.id}>
{user.name}
</div>
)}
{this.state.users.map(user => <div key={user.id}>{user.name}</div>)}
</div>
);
}
......
......@@ -29,11 +29,7 @@ export default class extends Component {
render() {
return (
<div id="feature-class-properties">
{this.users.map(user =>
<div key={user.id}>
{user.name}
</div>
)}
{this.users.map(user => <div key={user.id}>{user.name}</div>)}
</div>
);
}
......
......@@ -41,11 +41,9 @@ export default class extends Component {
render() {
return (
<div id="feature-computed-properties">
{this.state.users.map(user =>
<div key={user.id}>
{user.user_name}
</div>
)}
{this.state.users.map(user => (
<div key={user.id}>{user.user_name}</div>
))}
</div>
);
}
......
......@@ -53,11 +53,11 @@ export default class extends Component {
return (
<div id="feature-custom-interpolation">
{this.state.users.map(user =>
{this.state.users.map(user => (
<div key={user.id} style={veryInlineStyle}>
{user.name}
</div>
)}
))}
</div>
);
}
......
......@@ -41,11 +41,7 @@ export default class extends Component {
render() {
return (
<div id="feature-default-parameters">
{this.state.users.map(user =>
<div key={user.id}>
{user.name}
</div>
)}
{this.state.users.map(user => <div key={user.id}>{user.name}</div>)}
</div>
);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment