prettier 2

Summary:
Quick notes:

- This looks worse than it is. It adds mandatory parentheses to single argument lambdas. Lots of outrage on Twitter about it, personally I'm {emoji:1f937_200d_2642} about it.
- Space before function, e.g. `a = function ()` is now enforced. I like this because both were fine before.
- I added `eslint-config-prettier` to the config because otherwise a ton of rules conflict with eslint itself.

Close https://github.com/facebook/flipper/pull/915

Reviewed By: jknoxville

Differential Revision: D20594929

fbshipit-source-id: ca1c65376b90e009550dd6d1f4e0831d32cbff03
This commit is contained in:
Pascal Hartig
2020-03-24 09:34:39 -07:00
committed by Facebook GitHub Bot
parent d9d3be33b4
commit fc9ed65762
204 changed files with 877 additions and 864 deletions

View File

@@ -378,11 +378,11 @@ function addFileWatcherForiOSCrashLogs(
return;
}
const filepath = path.join(dir, filename);
promisify(fs.exists)(filepath).then(exists => {
promisify(fs.exists)(filepath).then((exists) => {
if (!exists) {
return;
}
fs.readFile(filepath, 'utf8', function(err, data) {
fs.readFile(filepath, 'utf8', function (err, data) {
if (store.getState().connections.selectedDevice?.os != 'iOS') {
// If the selected device is not iOS don't show crash notifications
return;
@@ -572,7 +572,7 @@ export default class CrashReporterPlugin extends FlipperDevicePlugin<
static getActiveNotifications = (
persistedState: PersistedState,
): Array<Notification> => {
const filteredCrashes = persistedState.crashes.filter(crash => {
const filteredCrashes = persistedState.crashes.filter((crash) => {
const ignore = !crash.name && !crash.reason;
const unknownCrashCause = crash.reason === UNKNOWN_CRASH_REASON;
if (ignore || unknownCrashCause) {
@@ -619,7 +619,7 @@ export default class CrashReporterPlugin extends FlipperDevicePlugin<
addFileWatcherForiOSCrashLogs(store, setPersistedState);
} else {
const referenceDate = new Date();
(function(
(function (
store: Store,
date: Date,
setPersistedState: (
@@ -679,7 +679,7 @@ export default class CrashReporterPlugin extends FlipperDevicePlugin<
let deeplinkedCrash = null;
if (this.props.deepLinkPayload) {
const id = this.props.deepLinkPayload;
const index = this.props.persistedState.crashes.findIndex(elem => {
const index = this.props.persistedState.crashes.findIndex((elem) => {
return elem.notificationID === id;
});
if (index >= 0) {
@@ -714,18 +714,18 @@ export default class CrashReporterPlugin extends FlipperDevicePlugin<
);
const orderedIDs = crashes.map(
persistedCrash => persistedCrash.notificationID,
(persistedCrash) => persistedCrash.notificationID,
);
const selectedCrashID = crash.notificationID;
const onCrashChange = id => {
const onCrashChange = (id) => {
const newSelectedCrash = crashes.find(
element => element.notificationID === id,
(element) => element.notificationID === id,
);
this.setState({crash: newSelectedCrash});
};
const callstackString = crash.callstack || '';
const children = callstackString.split('\n').map(str => {
const children = callstackString.split('\n').map((str) => {
return {message: str};
});
const crashSelector: CrashSelectorProps = {
@@ -767,7 +767,7 @@ export default class CrashReporterPlugin extends FlipperDevicePlugin<
},
]}>
<Line />
{children.map(child => {
{children.map((child) => {
return (
<StackTraceComponent
key={child.message}