Back out "Upgrade Prettier from 1.17 to 2.0.2."
Differential Revision: D20639755 fbshipit-source-id: 5028563f9cf0527a30b4259daac50cdc03934bfd
This commit is contained in:
committed by
Facebook GitHub Bot
parent
8658fca4dd
commit
37f0260116
@@ -33,7 +33,7 @@ beforeEach(() => {
|
||||
test('dispatcher dispatches REGISTER_PLUGINS', () => {
|
||||
dispatcher(mockStore, logger);
|
||||
const actions = mockStore.getActions();
|
||||
expect(actions.map(a => a.type)).toContain('REGISTER_PLUGINS');
|
||||
expect(actions.map((a) => a.type)).toContain('REGISTER_PLUGINS');
|
||||
});
|
||||
|
||||
test('getDynamicPlugins returns empty array on errors', () => {
|
||||
|
||||
@@ -64,7 +64,7 @@ test('TestIdler can be controlled', async () => {
|
||||
expect(idler.shouldIdle()).toBe(true);
|
||||
|
||||
let threw = false;
|
||||
const p = idler.idle().catch(e => {
|
||||
const p = idler.idle().catch((e) => {
|
||||
threw = true;
|
||||
expect(e).toMatchInlineSnapshot(
|
||||
`[CancelledPromiseError: Idler got killed]`,
|
||||
|
||||
@@ -26,7 +26,7 @@ const storage = new JsonFileStorage(
|
||||
test('A valid settings file gets parsed correctly', () => {
|
||||
return storage
|
||||
.getItem('anykey')
|
||||
.then(result => expect(result).toEqual(validDeserializedData));
|
||||
.then((result) => expect(result).toEqual(validDeserializedData));
|
||||
});
|
||||
|
||||
test('deserialize works as expected', () => {
|
||||
|
||||
@@ -72,7 +72,7 @@ export class FlipperConnection {
|
||||
}
|
||||
|
||||
receive(method: FlipperMethodID, receiver: FlipperReceiver<*>) {
|
||||
this._bridge.subscribe(this.pluginId, method, data => {
|
||||
this._bridge.subscribe(this.pluginId, method, (data) => {
|
||||
receiver(data, new FlipperResponder(this.pluginId, method, this._bridge));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ export class FuryPlugin extends FlipperPlugin {
|
||||
id: reqContext.currentSeqId + '/' + eventType,
|
||||
time: new Date().getTime(),
|
||||
eventType: eventType,
|
||||
callStack: stack.map(frame => {
|
||||
callStack: stack.map((frame) => {
|
||||
return {
|
||||
className: frame.getTypeName() || '',
|
||||
methodName: frame.getFunctionName() || '',
|
||||
|
||||
@@ -39,7 +39,7 @@ class FlipperWebviewBridgeImpl extends FlipperBridge {
|
||||
subscribe = (
|
||||
plugin: FlipperPluginID,
|
||||
method: FlipperMethodID,
|
||||
handler: any => void,
|
||||
handler: (any) => void,
|
||||
) => {
|
||||
this._subscriptions.set(plugin + method, handler);
|
||||
};
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
"eslint-plugin-prettier": "^3.1.1",
|
||||
"eslint-plugin-react": "^7.16.0",
|
||||
"jest": "^24.9.0",
|
||||
"prettier": "2.0.2",
|
||||
"prettier": "^2.0.0",
|
||||
"ts-jest": "^24.1.0",
|
||||
"tslint-config-prettier": "^1.18.0",
|
||||
"typescript": "^3.7.2"
|
||||
|
||||
@@ -60,13 +60,13 @@ const runHeadless = memoize((args: Array<string>): Promise<{
|
||||
console.info(`Running ${params.bin} ${args.join(' ')}`);
|
||||
const process = spawn(params.bin, args, {});
|
||||
process.stdout.setEncoding('utf8');
|
||||
process.stdout.on('data', chunk => {
|
||||
process.stdout.on('data', (chunk) => {
|
||||
stdoutChunks.push(chunk);
|
||||
});
|
||||
process.stderr.on('data', chunk => {
|
||||
process.stderr.on('data', (chunk) => {
|
||||
stderrChunks.push(chunk);
|
||||
});
|
||||
process.stdout.on('end', chunk => {
|
||||
process.stdout.on('end', (chunk) => {
|
||||
const stdout = stdoutChunks.join('');
|
||||
const stderr = stderrChunks.join('');
|
||||
try {
|
||||
@@ -89,7 +89,7 @@ const runHeadless = memoize((args: Array<string>): Promise<{
|
||||
});
|
||||
|
||||
function getPluginState(app: string, plugin: string): Promise<string> {
|
||||
return runHeadless(basicArgs).then(result => {
|
||||
return runHeadless(basicArgs).then((result) => {
|
||||
const pluginStates = result.output.store.pluginStates;
|
||||
for (const pluginId of Object.keys(pluginStates)) {
|
||||
const matches = /([^#]+)#([^#]+)#([^#]+)#([^#]+)#([^#]+)/.exec(pluginId);
|
||||
@@ -110,8 +110,10 @@ function getPluginState(app: string, plugin: string): Promise<string> {
|
||||
test(
|
||||
'Flipper app appears in exported clients',
|
||||
() => {
|
||||
return runHeadless(basicArgs).then(result => {
|
||||
expect(result.output.clients.map(c => c.query.app)).toContain('Flipper');
|
||||
return runHeadless(basicArgs).then((result) => {
|
||||
expect(result.output.clients.map((c) => c.query.app)).toContain(
|
||||
'Flipper',
|
||||
);
|
||||
});
|
||||
},
|
||||
TEST_TIMEOUT_MS,
|
||||
@@ -120,7 +122,7 @@ test(
|
||||
test(
|
||||
'Output includes fileVersion',
|
||||
() => {
|
||||
return runHeadless(basicArgs).then(result => {
|
||||
return runHeadless(basicArgs).then((result) => {
|
||||
expect(result.output.fileVersion).toMatch(/[0-9]+\.[0-9]+\.[0-9]+/);
|
||||
});
|
||||
},
|
||||
@@ -130,7 +132,7 @@ test(
|
||||
test(
|
||||
'Output includes device',
|
||||
() => {
|
||||
return runHeadless(basicArgs).then(result => {
|
||||
return runHeadless(basicArgs).then((result) => {
|
||||
expect(result.output.device).toBeTruthy();
|
||||
});
|
||||
},
|
||||
@@ -140,7 +142,7 @@ test(
|
||||
test(
|
||||
'Output includes flipperReleaseRevision',
|
||||
() => {
|
||||
return runHeadless(basicArgs).then(result => {
|
||||
return runHeadless(basicArgs).then((result) => {
|
||||
expect(result.output.flipperReleaseRevision).toBeTruthy();
|
||||
});
|
||||
},
|
||||
@@ -150,7 +152,7 @@ test(
|
||||
test(
|
||||
'Output includes store',
|
||||
() => {
|
||||
return runHeadless(basicArgs).then(result => {
|
||||
return runHeadless(basicArgs).then((result) => {
|
||||
expect(result.output.store).toBeTruthy();
|
||||
});
|
||||
},
|
||||
@@ -172,7 +174,7 @@ function stripNode(node: any, path: Array<string>) {
|
||||
}
|
||||
if (path[0] === '*') {
|
||||
if (Array.isArray(node)) {
|
||||
return node.map(e => stripNode(e, path.slice(1)));
|
||||
return node.map((e) => stripNode(e, path.slice(1)));
|
||||
}
|
||||
return Object.entries(node).reduce((acc, [key, val]) => {
|
||||
acc[key] = stripNode(val, path.slice(1));
|
||||
@@ -226,12 +228,12 @@ test('test layout snapshot stripping', () => {
|
||||
});
|
||||
|
||||
test('Sample app layout hierarchy matches snapshot', () => {
|
||||
return getPluginState('Flipper', 'Inspector').then(result => {
|
||||
return getPluginState('Flipper', 'Inspector').then((result) => {
|
||||
const state = JSON.parse(result);
|
||||
expect(state.rootAXElement).toBe('com.facebook.flipper.sample');
|
||||
expect(state.rootElement).toBe('com.facebook.flipper.sample');
|
||||
const canonicalizedElements = Object.values(state.elements)
|
||||
.map(e => {
|
||||
.map((e) => {
|
||||
const stableizedElements = stripUnstableLayoutAttributes(e);
|
||||
return stringify(stableizedElements);
|
||||
})
|
||||
|
||||
@@ -156,7 +156,7 @@
|
||||
"jest-fetch-mock": "^3.0.0",
|
||||
"metro": "^0.58.0",
|
||||
"metro-resolver": "^0.58.0",
|
||||
"prettier": "2.0.2",
|
||||
"prettier": "^2.0.0",
|
||||
"react-async": "^10.0.0",
|
||||
"recursive-readdir": "^2.2.2",
|
||||
"redux-mock-store": "^1.5.3",
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
"@types/node": "^13.7.5",
|
||||
"cli-ux": "^5.4.5",
|
||||
"fs-extra": "^8.1.0",
|
||||
"inquirer": "^7.0.5",
|
||||
"metro": "^0.58.0",
|
||||
"inquirer": "^7.0.5",
|
||||
"tslib": "^1"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -40,7 +40,7 @@
|
||||
"@types/jest": "^24.0.21",
|
||||
"globby": "^10",
|
||||
"jest": "^24.9.0",
|
||||
"prettier": "2.0.2",
|
||||
"prettier": "^2.0.0",
|
||||
"ts-jest": "^24.1.0",
|
||||
"ts-node": "^8",
|
||||
"typescript": "^3.7.2"
|
||||
|
||||
@@ -80,7 +80,7 @@ module.exports = function (babel) {
|
||||
|
||||
if (
|
||||
BUILTINS.includes(source) ||
|
||||
BUILTINS.some(moduleName => source.startsWith(`${moduleName}/`))
|
||||
BUILTINS.some((moduleName) => source.startsWith(`${moduleName}/`))
|
||||
) {
|
||||
path.node.callee.name = 'electronRequire';
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ const path = require('path');
|
||||
const replaceFBStubs = fs.existsSync(
|
||||
path.join(__dirname, '..', '..', 'app', 'src', 'fb'),
|
||||
);
|
||||
const isFBFile = filePath => filePath.includes(`${path.sep}fb${path.sep}`);
|
||||
const isFBFile = (filePath) => filePath.includes(`${path.sep}fb${path.sep}`);
|
||||
|
||||
const requireFromFolder = (folder, path) =>
|
||||
new RegExp(folder + '/[A-Za-z0-9.-_]+(.js)?$', 'g').test(path);
|
||||
|
||||
@@ -378,7 +378,7 @@ function addFileWatcherForiOSCrashLogs(
|
||||
return;
|
||||
}
|
||||
const filepath = path.join(dir, filename);
|
||||
promisify(fs.exists)(filepath).then(exists => {
|
||||
promisify(fs.exists)(filepath).then((exists) => {
|
||||
if (!exists) {
|
||||
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) {
|
||||
@@ -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}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
import type {PluginClient, Value} from 'flipper';
|
||||
|
||||
type ClientCall<Params, Response> = Params => Promise<Response>;
|
||||
type ClientCall<Params, Response> = (Params) => Promise<Response>;
|
||||
|
||||
type DatabaseListRequest = {};
|
||||
|
||||
@@ -78,24 +78,22 @@ export class DatabaseClient {
|
||||
this.client = pluginClient;
|
||||
}
|
||||
|
||||
getDatabases: ClientCall<
|
||||
DatabaseListRequest,
|
||||
DatabaseListResponse,
|
||||
> = params => this.client.call('databaseList', {});
|
||||
getDatabases: ClientCall<DatabaseListRequest, DatabaseListResponse> = (
|
||||
params,
|
||||
) => this.client.call('databaseList', {});
|
||||
|
||||
getTableData: ClientCall<QueryTableRequest, QueryTableResponse> = params =>
|
||||
getTableData: ClientCall<QueryTableRequest, QueryTableResponse> = (params) =>
|
||||
this.client.call('getTableData', params);
|
||||
|
||||
getTableStructure: ClientCall<
|
||||
GetTableStructureRequest,
|
||||
GetTableStructureResponse,
|
||||
> = params => this.client.call('getTableStructure', params);
|
||||
> = (params) => this.client.call('getTableStructure', params);
|
||||
|
||||
getExecution: ClientCall<ExecuteSqlRequest, ExecuteSqlResponse> = params =>
|
||||
getExecution: ClientCall<ExecuteSqlRequest, ExecuteSqlResponse> = (params) =>
|
||||
this.client.call('execute', params);
|
||||
|
||||
getTableInfo: ClientCall<
|
||||
GetTableInfoRequest,
|
||||
GetTableInfoResponse,
|
||||
> = params => this.client.call('getTableInfo', params);
|
||||
getTableInfo: ClientCall<GetTableInfoRequest, GetTableInfoResponse> = (
|
||||
params,
|
||||
) => this.client.call('getTableInfo', params);
|
||||
}
|
||||
|
||||
@@ -250,7 +250,7 @@ function renderTable(page: ?Page, component: DatabasesPlugin) {
|
||||
<ManagedTable
|
||||
tableKey={`databases-${page.databaseId}-${page.table}`}
|
||||
floating={false}
|
||||
columnOrder={page.columns.map(name => ({
|
||||
columnOrder={page.columns.map((name) => ({
|
||||
key: name,
|
||||
visible: true,
|
||||
}))}
|
||||
@@ -281,7 +281,7 @@ function renderDatabaseColumns(structure: ?Structure) {
|
||||
<FlexRow grow={true}>
|
||||
<ManagedTable
|
||||
floating={false}
|
||||
columnOrder={structure.columns.map(name => ({
|
||||
columnOrder={structure.columns.map((name) => ({
|
||||
key: name,
|
||||
visible: true,
|
||||
}))}
|
||||
@@ -305,7 +305,7 @@ function renderDatabaseIndexes(structure: ?Structure) {
|
||||
<FlexRow grow={true}>
|
||||
<ManagedTable
|
||||
floating={false}
|
||||
columnOrder={structure.indexesColumns.map(name => ({
|
||||
columnOrder={structure.indexesColumns.map((name) => ({
|
||||
key: name,
|
||||
visible: true,
|
||||
}))}
|
||||
@@ -686,7 +686,7 @@ export default class DatabasesPlugin extends FlipperPlugin<
|
||||
databaseId: state.selectedDatabase,
|
||||
value: this.state.query.value,
|
||||
})
|
||||
.then(data => {
|
||||
.then((data) => {
|
||||
this.setState({
|
||||
error: null,
|
||||
executionTime: Date.now() - timeBefore,
|
||||
@@ -709,7 +709,7 @@ export default class DatabasesPlugin extends FlipperPlugin<
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
.catch((e) => {
|
||||
this.setState({error: e});
|
||||
});
|
||||
}
|
||||
@@ -864,7 +864,7 @@ export default class DatabasesPlugin extends FlipperPlugin<
|
||||
table: table,
|
||||
start: newState.pageRowNumber,
|
||||
})
|
||||
.then(data => {
|
||||
.then((data) => {
|
||||
this.dispatchAction({
|
||||
type: 'UpdatePage',
|
||||
databaseId: databaseId,
|
||||
@@ -876,7 +876,7 @@ export default class DatabasesPlugin extends FlipperPlugin<
|
||||
total: data.total,
|
||||
});
|
||||
})
|
||||
.catch(e => {
|
||||
.catch((e) => {
|
||||
this.setState({error: e});
|
||||
});
|
||||
}
|
||||
@@ -891,7 +891,7 @@ export default class DatabasesPlugin extends FlipperPlugin<
|
||||
databaseId: databaseId,
|
||||
table: table,
|
||||
})
|
||||
.then(data => {
|
||||
.then((data) => {
|
||||
this.dispatchAction({
|
||||
type: 'UpdateStructure',
|
||||
databaseId: databaseId,
|
||||
@@ -902,7 +902,7 @@ export default class DatabasesPlugin extends FlipperPlugin<
|
||||
indexesValues: data.indexesValues,
|
||||
});
|
||||
})
|
||||
.catch(e => {
|
||||
.catch((e) => {
|
||||
this.setState({error: e});
|
||||
});
|
||||
}
|
||||
@@ -917,19 +917,19 @@ export default class DatabasesPlugin extends FlipperPlugin<
|
||||
databaseId: databaseId,
|
||||
table: table,
|
||||
})
|
||||
.then(data => {
|
||||
.then((data) => {
|
||||
this.dispatchAction({
|
||||
type: 'UpdateTableInfo',
|
||||
tableInfo: data.definition,
|
||||
});
|
||||
})
|
||||
.catch(e => {
|
||||
.catch((e) => {
|
||||
this.setState({error: e});
|
||||
});
|
||||
}
|
||||
|
||||
if (!previousState.outdatedDatabaseList && newState.outdatedDatabaseList) {
|
||||
this.databaseClient.getDatabases({}).then(databases => {
|
||||
this.databaseClient.getDatabases({}).then((databases) => {
|
||||
this.dispatchAction({
|
||||
type: 'UpdateDatabases',
|
||||
databases,
|
||||
@@ -940,7 +940,7 @@ export default class DatabasesPlugin extends FlipperPlugin<
|
||||
|
||||
init() {
|
||||
this.databaseClient = new DatabaseClient(this.client);
|
||||
this.databaseClient.getDatabases({}).then(databases => {
|
||||
this.databaseClient.getDatabases({}).then((databases) => {
|
||||
this.dispatchAction({
|
||||
type: 'UpdateDatabases',
|
||||
databases,
|
||||
@@ -987,7 +987,7 @@ export default class DatabasesPlugin extends FlipperPlugin<
|
||||
};
|
||||
|
||||
onDatabaseSelected = (selected: string) => {
|
||||
const dbId = this.state.databases.find(x => x.name === selected)?.id || 0;
|
||||
const dbId = this.state.databases.find((x) => x.name === selected)?.id || 0;
|
||||
this.dispatchAction({
|
||||
database: dbId,
|
||||
type: 'UpdateSelectedDatabase',
|
||||
@@ -1164,7 +1164,7 @@ export default class DatabasesPlugin extends FlipperPlugin<
|
||||
<ManagedTable
|
||||
floating={false}
|
||||
multiline={true}
|
||||
columnOrder={columns.map(name => ({
|
||||
columnOrder={columns.map((name) => ({
|
||||
key: name,
|
||||
visible: true,
|
||||
}))}
|
||||
@@ -1175,7 +1175,7 @@ export default class DatabasesPlugin extends FlipperPlugin<
|
||||
zebra={true}
|
||||
rows={rows}
|
||||
horizontallyScrollable={true}
|
||||
onRowHighlighted={highlightedRows => {
|
||||
onRowHighlighted={(highlightedRows) => {
|
||||
this.setState({
|
||||
queryResult: {
|
||||
table: {
|
||||
@@ -1267,7 +1267,7 @@ export default class DatabasesPlugin extends FlipperPlugin<
|
||||
<BoldSpan style={{marginRight: 16}}>Database</BoldSpan>
|
||||
<Select
|
||||
options={this.state.databases
|
||||
.map(x => x.name)
|
||||
.map((x) => x.name)
|
||||
.reduce((obj, item) => {
|
||||
obj[item] = item;
|
||||
return obj;
|
||||
@@ -1293,7 +1293,7 @@ export default class DatabasesPlugin extends FlipperPlugin<
|
||||
<BoldSpan style={{marginRight: 16}}>Database</BoldSpan>
|
||||
<Select
|
||||
options={this.state.databases
|
||||
.map(x => x.name)
|
||||
.map((x) => x.name)
|
||||
.reduce((obj, item) => {
|
||||
obj[item] = item;
|
||||
return obj;
|
||||
@@ -1343,7 +1343,7 @@ export default class DatabasesPlugin extends FlipperPlugin<
|
||||
/>
|
||||
{this.state.favorites !== null ? (
|
||||
<Button
|
||||
dropdown={this.state.favorites.map(option => {
|
||||
dropdown={this.state.favorites.map((option) => {
|
||||
return {
|
||||
click: () => {
|
||||
this.setState({
|
||||
|
||||
@@ -64,7 +64,7 @@ export default class DetailsPanel extends Component<Props> {
|
||||
floating={false}
|
||||
heading={'Changesets'}>
|
||||
<MarkerTimeline
|
||||
points={changeSets.map(p => ({
|
||||
points={changeSets.map((p) => ({
|
||||
label:
|
||||
p.type === 'CHANGESET_GENERATED' ? 'Generated' : 'Rendered',
|
||||
time: Math.round((p.timestamp || 0) - firstChangeSet),
|
||||
@@ -72,9 +72,9 @@ export default class DetailsPanel extends Component<Props> {
|
||||
p.type === 'CHANGESET_GENERATED' ? colors.lemon : colors.teal,
|
||||
key: p.identifier,
|
||||
}))}
|
||||
onClick={ids =>
|
||||
onClick={(ids) =>
|
||||
this.props.onFocusChangeSet(
|
||||
changeSets.find(c => c.identifier === ids[0]),
|
||||
changeSets.find((c) => c.identifier === ids[0]),
|
||||
)
|
||||
}
|
||||
selected={this.props.focusedChangeSet?.identifier}
|
||||
|
||||
@@ -29,7 +29,7 @@ const Container = styled(FlexRow)({
|
||||
flexGrow: 1,
|
||||
});
|
||||
|
||||
const SurfaceContainer = styled(FlexColumn)(props => ({
|
||||
const SurfaceContainer = styled(FlexColumn)((props) => ({
|
||||
position: 'relative',
|
||||
'::after': {
|
||||
display: props.scrolled ? 'block' : 'none',
|
||||
@@ -50,7 +50,7 @@ const TimeContainer = styled(FlexColumn)({
|
||||
flexShrink: 1,
|
||||
});
|
||||
|
||||
const Row = styled(FlexRow)(props => ({
|
||||
const Row = styled(FlexRow)((props) => ({
|
||||
alignItems: 'center',
|
||||
paddingBottom: 3,
|
||||
marginTop: 3,
|
||||
@@ -174,7 +174,7 @@ export default class extends Component<Props, State> {
|
||||
let nextGenerationId = null;
|
||||
|
||||
const index = this.props.generations.findIndex(
|
||||
g => g.id === this.props.focusedGenerationId,
|
||||
(g) => g.id === this.props.focusedGenerationId,
|
||||
);
|
||||
|
||||
const direction = e.key === 'ArrowRight' ? 1 : -1;
|
||||
@@ -206,14 +206,14 @@ export default class extends Component<Props, State> {
|
||||
return (
|
||||
<Container>
|
||||
<SurfaceContainer scrolled={this.state.scrolled}>
|
||||
{[...surfaces].map(surface => (
|
||||
{[...surfaces].map((surface) => (
|
||||
<Row key={surface}>
|
||||
<Label title={surface}>{surface}</Label>
|
||||
</Row>
|
||||
))}
|
||||
</SurfaceContainer>
|
||||
<TimeContainer onScroll={this.onScroll}>
|
||||
{[...surfaces].map(surface => (
|
||||
{[...surfaces].map((surface) => (
|
||||
<Row key={surface} showTimeline>
|
||||
{this.props.generations.map((record: TreeGeneration) =>
|
||||
record.surface_key === surface ? (
|
||||
|
||||
@@ -30,7 +30,7 @@ export default class extends React.Component<Props> {
|
||||
if (this.props.skipStackTraceFormat) {
|
||||
return (
|
||||
<StackTrace backgroundColor={colors.white}>
|
||||
{this.props.data.map(stack_trace_line => {
|
||||
{this.props.data.map((stack_trace_line) => {
|
||||
return {
|
||||
caller: stack_trace_line,
|
||||
};
|
||||
@@ -43,10 +43,10 @@ export default class extends React.Component<Props> {
|
||||
<StackTrace backgroundColor={colors.white}>
|
||||
{/* We need to filter out from the stack trace any reference to the plugin such that the information is more coincised and focused */}
|
||||
{this.props.data
|
||||
.filter(stack_trace_line => {
|
||||
.filter((stack_trace_line) => {
|
||||
return !stack_trace_line.includes('FlipperKitSectionsPlugin');
|
||||
})
|
||||
.map(stack_trace_line => {
|
||||
.map((stack_trace_line) => {
|
||||
const trace = REGEX.exec(stack_trace_line)?.groups;
|
||||
return {
|
||||
bold: !isSystemLibrary(trace?.library),
|
||||
|
||||
@@ -13,7 +13,7 @@ import {Glyph, PureComponent, styled, Toolbar, Spacer, colors} from 'flipper';
|
||||
import {Tree} from 'react-d3-tree';
|
||||
import {Fragment} from 'react';
|
||||
|
||||
const Legend = styled.div(props => ({
|
||||
const Legend = styled.div((props) => ({
|
||||
color: colors.dark50,
|
||||
marginLeft: 20,
|
||||
'&::before': {
|
||||
@@ -98,7 +98,7 @@ class NodeLabel extends PureComponent<Props, State> {
|
||||
collapsed: false,
|
||||
};
|
||||
|
||||
showNodeData = e => {
|
||||
showNodeData = (e) => {
|
||||
e.stopPropagation();
|
||||
this.props.onLabelClicked(this.props?.nodeData);
|
||||
};
|
||||
@@ -136,7 +136,7 @@ class NodeLabel extends PureComponent<Props, State> {
|
||||
|
||||
export default class extends PureComponent<Props, State> {
|
||||
treeFromFlatArray = (data: TreeData) => {
|
||||
const tree = data.map(n => {
|
||||
const tree = data.map((n) => {
|
||||
let fill = colors.blueGreyTint70;
|
||||
if (n.didTriggerStateUpdate) {
|
||||
fill = colors.lemon;
|
||||
@@ -184,12 +184,12 @@ export default class extends PureComponent<Props, State> {
|
||||
}
|
||||
}, new Map());
|
||||
|
||||
tree.forEach(n => {
|
||||
tree.forEach((n) => {
|
||||
n.children = parentMap.get(n.attributes.identifier) || [];
|
||||
});
|
||||
|
||||
// find the root node
|
||||
return tree.find(node => !node.attributes.parent);
|
||||
return tree.find((node) => !node.attributes.parent);
|
||||
};
|
||||
|
||||
treeFromHierarchy = (data: SectionComponentHierarchy): Object => {
|
||||
@@ -244,7 +244,7 @@ export default class extends PureComponent<Props, State> {
|
||||
return (
|
||||
<Fragment>
|
||||
<Container
|
||||
innerRef={ref => {
|
||||
innerRef={(ref) => {
|
||||
this.treeContainer = ref;
|
||||
}}>
|
||||
<style>
|
||||
|
||||
@@ -35,7 +35,7 @@ import {
|
||||
DetailSidebar,
|
||||
} from 'flipper';
|
||||
|
||||
const Waiting = styled(FlexBox)(props => ({
|
||||
const Waiting = styled(FlexBox)((props) => ({
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
flexGrow: 1,
|
||||
@@ -45,14 +45,14 @@ const Waiting = styled(FlexBox)(props => ({
|
||||
textAlign: 'center',
|
||||
}));
|
||||
|
||||
const InfoText = styled.div(props => ({
|
||||
const InfoText = styled.div((props) => ({
|
||||
marginTop: 10,
|
||||
marginBottom: 10,
|
||||
fontWeight: '500',
|
||||
color: colors.light30,
|
||||
}));
|
||||
|
||||
const InfoBox = styled.div(props => ({
|
||||
const InfoBox = styled.div((props) => ({
|
||||
maxWidth: 400,
|
||||
margin: 'auto',
|
||||
textAlign: 'center',
|
||||
|
||||
@@ -9,11 +9,11 @@
|
||||
|
||||
const {ipcRenderer} = require('electron');
|
||||
|
||||
global.sendToHost = message => {
|
||||
global.sendToHost = (message) => {
|
||||
ipcRenderer.sendToHost(message);
|
||||
};
|
||||
|
||||
global.setupToReceiveHostMessage = callback => {
|
||||
global.setupToReceiveHostMessage = (callback) => {
|
||||
ipcRenderer.on('hostMessage', (event, message) => {
|
||||
callback(message);
|
||||
});
|
||||
|
||||
@@ -21,5 +21,5 @@ test('transform electron requires to inlined stubs', () => {
|
||||
const transformed = transform(src, babelOptions).ast;
|
||||
const body = transformed.program.body[0];
|
||||
expect(body.type).toBe('ExpressionStatement');
|
||||
expect(body.expression.properties.map(p => p.key.name)).toContain('remote');
|
||||
expect(body.expression.properties.map((p) => p.key.name)).toContain('remote');
|
||||
});
|
||||
|
||||
@@ -80,7 +80,7 @@ module.exports = function (babel) {
|
||||
|
||||
if (
|
||||
BUILTINS.includes(source) ||
|
||||
BUILTINS.some(moduleName => source.startsWith(`${moduleName}/`))
|
||||
BUILTINS.some((moduleName) => source.startsWith(`${moduleName}/`))
|
||||
) {
|
||||
path.node.callee.name = 'electronRequire';
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ const path = require('path');
|
||||
const replaceFBStubs = fs.existsSync(
|
||||
path.join(__dirname, '..', '..', 'app', 'src', 'fb'),
|
||||
);
|
||||
const isFBFile = filePath => filePath.includes(`${path.sep}fb${path.sep}`);
|
||||
const isFBFile = (filePath) => filePath.includes(`${path.sep}fb${path.sep}`);
|
||||
|
||||
const requireFromFolder = (folder, path) =>
|
||||
new RegExp(folder + '/[A-Za-z0-9.-_]+(.js)?$', 'g').test(path);
|
||||
|
||||
@@ -2951,7 +2951,7 @@
|
||||
dependencies:
|
||||
"@types/react" "*"
|
||||
|
||||
"@types/react-dom@*", "@types/react-dom@^16.9.4":
|
||||
"@types/react-dom@*", "@types/react-dom@16.9.4", "@types/react-dom@^16.9.4":
|
||||
version "16.9.4"
|
||||
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-16.9.4.tgz#0b58df09a60961dcb77f62d4f1832427513420df"
|
||||
integrity sha512-fya9xteU/n90tda0s+FtN5Ym4tbgxpq/hb/Af24dvs6uYnYn+fspaxw5USlw0R8apDNwxsqumdRoCoKitckQqw==
|
||||
@@ -3004,7 +3004,7 @@
|
||||
dependencies:
|
||||
"@types/react" "*"
|
||||
|
||||
"@types/react@*", "@types/react@^16.9.17":
|
||||
"@types/react@*", "@types/react@16.9.17", "@types/react@^16.9.17":
|
||||
version "16.9.17"
|
||||
resolved "https://registry.yarnpkg.com/@types/react/-/react-16.9.17.tgz#58f0cc0e9ec2425d1441dd7b623421a867aa253e"
|
||||
integrity sha512-UP27In4fp4sWF5JgyV6pwVPAQM83Fj76JOcg02X5BZcpSu5Wx+fP9RMqc2v0ssBoQIFvD5JdKY41gjJJKmw6Bg==
|
||||
@@ -3346,16 +3346,16 @@ acorn@^7.1.0:
|
||||
resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.1.0.tgz#949d36f2c292535da602283586c2477c57eb2d6c"
|
||||
integrity sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ==
|
||||
|
||||
adbkit-logcat@2, adbkit-logcat@^2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/adbkit-logcat/-/adbkit-logcat-2.0.1.tgz#d4986b9fc7cfda42733389d46a52124abef43ca5"
|
||||
integrity sha512-MznVzzEzcrWhIaIyblll+a0AL1TICJe/yuaia7HDYTAtiNabR/9amJkAnLt30U8/W7MVBc3mvU1jB/6MJ/TYHw==
|
||||
|
||||
adbkit-logcat@^1.1.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/adbkit-logcat/-/adbkit-logcat-1.1.0.tgz#01d7f9b0cef9093a30bcb3b007efff301508962f"
|
||||
integrity sha1-Adf5sM75CTowvLOwB+//MBUIli8=
|
||||
|
||||
adbkit-logcat@^2.0.1:
|
||||
version "2.0.1"
|
||||
resolved "https://registry.yarnpkg.com/adbkit-logcat/-/adbkit-logcat-2.0.1.tgz#d4986b9fc7cfda42733389d46a52124abef43ca5"
|
||||
integrity sha512-MznVzzEzcrWhIaIyblll+a0AL1TICJe/yuaia7HDYTAtiNabR/9amJkAnLt30U8/W7MVBc3mvU1jB/6MJ/TYHw==
|
||||
|
||||
adbkit-monkey@~1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/adbkit-monkey/-/adbkit-monkey-1.0.1.tgz#f291be701a2efc567a63fc7aa6afcded31430be1"
|
||||
@@ -10438,16 +10438,16 @@ prettier-linter-helpers@^1.0.0:
|
||||
dependencies:
|
||||
fast-diff "^1.1.2"
|
||||
|
||||
prettier@2.0.2:
|
||||
version "2.0.2"
|
||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.0.2.tgz#1ba8f3eb92231e769b7fcd7cb73ae1b6b74ade08"
|
||||
integrity sha512-5xJQIPT8BraI7ZnaDwSbu5zLrB6vvi8hVV58yHQ+QK64qrY40dULy0HSRlQ2/2IdzeBpjhDkqdcFBnFeDEMVdg==
|
||||
|
||||
prettier@^1.14.2:
|
||||
version "1.18.2"
|
||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.18.2.tgz#6823e7c5900017b4bd3acf46fe9ac4b4d7bda9ea"
|
||||
integrity sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw==
|
||||
|
||||
prettier@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.0.0.tgz#9c8fdba0aeae3faf0d9d9391623ac4f9321a4455"
|
||||
integrity sha512-vI55PC+GFLOVtpwr2di1mYhJF36v+kztJov8sx3AmqbfdA+2Dhozxb+3e1hTgoV9lyhnVJFF3Z8GCVeMBOS1bA==
|
||||
|
||||
pretty-format@^24.3.0, pretty-format@^24.7.0, pretty-format@^24.9.0:
|
||||
version "24.9.0"
|
||||
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.9.0.tgz#12fac31b37019a4eea3c11aa9a959eb7628aa7c9"
|
||||
|
||||
Reference in New Issue
Block a user