Skip to content

Commit 9292cf9

Browse files
fabriziocuccikosmydel
authored andcommitted
Drop unused code + minor lint fixes (facebook#44645)
Summary: Pull Request resolved: facebook#44645 Changelog: [Internal] As per title. Reviewed By: NickGerleman Differential Revision: D57664819 fbshipit-source-id: 2388bd01c00d814a12de7f2e285b78f207e6012c
1 parent e1fc6d7 commit 9292cf9

11 files changed

Lines changed: 82 additions & 181 deletions

File tree

packages/core-cli-utils/src/private/utils.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ type PathCheckResult = {
4141
export function isOnPath(dep: string, description: string): PathCheckResult {
4242
const cmd = isWindows ? ['where', [dep]] : ['command', ['-v', dep]];
4343
try {
44-
const args = isWindows ? ['where', [dep]] : ['command', ['-v', dep]];
4544
return {
4645
dep,
4746
description,

packages/dev-middleware/src/__tests__/InspectorProxyCdpRewritingHacks-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
* @oncall react_native
1010
*/
1111

12-
import type {TargetCapabilityFlags} from '../inspector-proxy/types';
13-
1412
import {allowSelfSignedCertsInNodeFetch} from './FetchUtils';
1513
import {
1614
createAndConnectTarget,

packages/dev-middleware/src/__tests__/InspectorProxyHttpApi-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ import {createDeviceMock} from './InspectorDeviceUtils';
1919
import {withAbortSignalForEachTest} from './ResourceUtils';
2020
import {withServerForEachTest} from './ServerUtils';
2121

22-
import nullthrows from 'nullthrows';
23-
2422
// Must be greater than or equal to PAGES_POLLING_INTERVAL in `InspectorProxy.js`.
2523
const PAGES_POLLING_DELAY = 1000;
2624

packages/react-native-bots/dangerfile.js

Lines changed: 0 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
const {danger, fail, /*message,*/ warn} = require('danger');
1717
const includes = require('lodash.includes');
18-
const fetch = require('node-fetch');
1918
const {validate: validateChangelog} =
2019
require('@rnx-kit/rn-changelog-generator').default;
2120

@@ -101,84 +100,3 @@ if (isMergeRefStable) {
101100
labels: ['Pick Request'],
102101
});
103102
}
104-
105-
// Wait for statuses and post a message if there are failures.
106-
async function handleStatuses() {
107-
const regex = /Test Suites: \d+ failed/;
108-
let startChecking = Date.now();
109-
let done = false;
110-
while (!done) {
111-
let now = Date.now();
112-
if (now - startChecking > 90 * 60 * 1000) {
113-
warn(
114-
"One hour and a half have passed and the E2E jobs haven't finished yet.",
115-
);
116-
done = true;
117-
continue;
118-
}
119-
120-
const githubBaseURL = `https://api.github.com/repos/${danger.github.pr.base.repo.owner.login}/${danger.github.pr.base.repo.name}`;
121-
const statusesURL = `${githubBaseURL}/commits/${danger.github.pr.head.sha}/statuses?per_page=100`;
122-
123-
const response = await fetch(statusesURL, {
124-
headers: {
125-
Accept: 'application/vnd.github+json',
126-
'X-GitHub-Api-Version': '2022-11-28',
127-
Authorization: `Bearer ${process.env.DANGER_GITHUB_API_TOKEN}`,
128-
},
129-
});
130-
131-
const data = await response.json();
132-
const e2e_jobs = data.filter(job => {
133-
return (
134-
job.context === 'ci/circleci: test_e2e_ios'
135-
// test_e2e_android does not currently tun
136-
// || job.context === 'ci/circleci: test_e2e_android'
137-
);
138-
});
139-
if (e2e_jobs.length <= 0) {
140-
console.log('No e2e jobs found yet, retrying in 5 minutes.');
141-
await new Promise(resolve => setTimeout(resolve, 5 * 60 * 1000));
142-
continue;
143-
}
144-
145-
const jobFinished = e2e_jobs.every(job => job.state !== 'pending');
146-
if (!jobFinished) {
147-
console.log("E2E jobs haven't finished yet, retrying in 5 minutes.");
148-
await new Promise(resolve => setTimeout(resolve, 5 * 60 * 1000));
149-
continue;
150-
}
151-
152-
e2e_jobs.forEach(async job => {
153-
const url = job.target_url;
154-
const components = url.split('/');
155-
const jobId = components[components.length - 1];
156-
const jobUrl = `https://circleci.com/api/v2/project/gh/facebook/react-native/${jobId}`;
157-
const artifactUrl = `${jobUrl}/artifacts`;
158-
const artifactResponse = await fetch(artifactUrl);
159-
const artifactData = await artifactResponse.json();
160-
const testLogs = artifactData.items.filter(
161-
item => item.path === 'tmp/test_log',
162-
);
163-
if (testLogs.length !== 1) {
164-
warn(
165-
`Can't find the E2E test log for ${job.context}. <a href=${jobUrl}>Job link</a>`,
166-
);
167-
return;
168-
}
169-
170-
const logUrl = testLogs[0].url;
171-
const logResponseText = await fetch(logUrl);
172-
const logText = await logResponseText.text();
173-
174-
if (regex.test(logText)) {
175-
warn(
176-
`E2E tests for ${job.context} failed with errors. See the <a href="${logUrl}">logs for details<a/>`,
177-
);
178-
}
179-
});
180-
done = true;
181-
}
182-
}
183-
184-
// handleStatuses();

packages/react-native/Libraries/Inspector/ElementProperties.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class ElementProperties extends React.Component<Props> {
7171
<View style={styles.col}>
7272
<StyleInspector style={style} />
7373
</View>
74-
{<BoxInspector style={style} frame={this.props.frame} />}
74+
<BoxInspector style={style} frame={this.props.frame} />
7575
</View>
7676
</View>
7777
</TouchableWithoutFeedback>

packages/react-native/Libraries/JSInspector/NetworkAgent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ class Interceptor {
232232
const event: LoadingFinishedEvent = {
233233
requestId: String(id),
234234
timestamp: JSInspector.getTimestamp(),
235-
encodedDataLength: encodedDataLength,
235+
encodedDataLength,
236236
};
237237
this._agent.sendEvent('loadingFinished', event);
238238
}

packages/rn-tester/js/components/RNTTitleBar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const HeaderIOS = ({
3636
<View
3737
style={[styles.header, {backgroundColor: theme.SystemBackgroundColor}]}>
3838
<View style={styles.headerCenter}>
39-
<Text style={{...styles.title, ...{color: theme.LabelColor}}}>
39+
<Text style={{...styles.title, color: theme.LabelColor}}>
4040
{title}
4141
</Text>
4242
{documentationURL && (

packages/rn-tester/js/examples/PanResponder/PanResponderExample.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,6 @@ const RNTesterPage = require('../../components/RNTesterPage');
2020
const React = require('react');
2121
const {PanResponder, StyleSheet, View} = require('react-native');
2222

23-
type CircleStyles = {
24-
backgroundColor?: string,
25-
left?: number,
26-
top?: number,
27-
...
28-
};
29-
3023
const CIRCLE_SIZE = 80;
3124

3225
type Props = $ReadOnly<{||}>;
@@ -39,7 +32,6 @@ type State = {|
3932
class PanResponderExample extends React.Component<Props, State> {
4033
_previousLeft: number = 20;
4134
_previousTop: number = 84;
42-
_circleStyles: {|style: CircleStyles|} = {style: {}};
4335
circle: ?React.ElementRef<typeof View> = null;
4436

4537
state: State = {
@@ -147,7 +139,7 @@ exports.description =
147139
exports.examples = [
148140
{
149141
title: 'Basic gesture handling',
150-
render: function (): React.Element<typeof PanResponderExample> {
142+
render(): React.Element<typeof PanResponderExample> {
151143
return <PanResponderExample />;
152144
},
153145
},

0 commit comments

Comments
 (0)