Skip to content

Commit 0cd69e8

Browse files
janicduplessisfacebook-github-bot
authored andcommitted
Run eslint --fix
Summary: CI is currently failing because of a lint issue, this fixes it and a bunch of other warnings that are auto-fixable. **Test plan** Quick manual test, cosmetic changes only. Closes #16229 Differential Revision: D6009748 Pulled By: TheSavior fbshipit-source-id: cabd44fed99dd90bd0b35626492719c139c89f34
1 parent 32e5c8e commit 0cd69e8

File tree

58 files changed

+500
-504
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+500
-504
lines changed

ContainerShip/scripts/run-android-ci-instrumentation-tests.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const test_opts = {
4545

4646
OFFSET: argv.offset,
4747
COUNT: argv.count
48-
}
48+
};
4949

5050
let max_test_class_length = Number.NEGATIVE_INFINITY;
5151

@@ -85,14 +85,14 @@ if (test_opts.COUNT != null && test_opts.OFFSET != null) {
8585
}
8686

8787
return async.mapSeries(testClasses, (clazz, callback) => {
88-
if(clazz.length > max_test_class_length) {
88+
if (clazz.length > max_test_class_length) {
8989
max_test_class_length = clazz.length;
9090
}
9191

9292
return async.retry(test_opts.RETRIES, (retryCb) => {
9393
const test_process = child_process.spawn('./ContainerShip/scripts/run-instrumentation-tests-via-adb-shell.sh', [test_opts.PACKAGE, clazz], {
9494
stdio: 'inherit'
95-
})
95+
});
9696

9797
const timeout = setTimeout(() => {
9898
test_process.kill();
@@ -106,7 +106,7 @@ return async.mapSeries(testClasses, (clazz, callback) => {
106106
test_process.on('exit', (code) => {
107107
clearTimeout(timeout);
108108

109-
if(code !== 0) {
109+
if (code !== 0) {
110110
return retryCb(new Error(`Process exited with code: ${code}`));
111111
}
112112

@@ -138,16 +138,16 @@ function print_test_suite_results(results) {
138138
function pad_output(num_chars) {
139139
let i = 0;
140140

141-
while(i < num_chars) {
141+
while (i < num_chars) {
142142
process.stdout.write(' ');
143143
i++;
144144
}
145145
}
146146
results.forEach((test) => {
147-
if(test.status === 'success') {
147+
if (test.status === 'success') {
148148
color = colors.GREEN;
149149
passing_suites++;
150-
} else if(test.status === 'failure') {
150+
} else if (test.status === 'failure') {
151151
color = colors.RED;
152152
failing_suites++;
153153
}

IntegrationTests/AsyncStorageTest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ function testOptimizedMultiGet() {
155155
let keys = batch.map(([key, value]) => key);
156156
AsyncStorage.multiSet(batch, (err1) => {
157157
// yes, twice on purpose
158-
;[1, 2].forEach((i) => {
158+
[1, 2].forEach((i) => {
159159
expectAsyncNoError(`${i} testOptimizedMultiGet/multiSet`, err1);
160160
AsyncStorage.multiGet(keys, (err2, result) => {
161161
expectAsyncNoError(`${i} testOptimizedMultiGet/multiGet`, err2);

IntegrationTests/ImageCachePolicyTest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class ImageCachePolicyTest extends React.Component<Props, $FlowFixMeState> {
4848
const results: Array<?boolean> = TESTS.map(x => nextState[x]);
4949

5050
if (!results.includes(undefined)) {
51-
const result: boolean = results.reduce((x,y) => x === y === true, true)
51+
const result: boolean = results.reduce((x,y) => x === y === true, true);
5252
TestModule.markTestPassed(result);
5353
}
5454

Libraries/Components/ScrollResponder.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ var ScrollResponderMixin = {
548548
warning(
549549
typeof keyboardShouldPersistTaps !== 'boolean',
550550
`'keyboardShouldPersistTaps={${keyboardShouldPersistTaps}}' is deprecated. `
551-
+ `Use 'keyboardShouldPersistTaps="${keyboardShouldPersistTaps ? "always" : "never"}"' instead`
551+
+ `Use 'keyboardShouldPersistTaps="${keyboardShouldPersistTaps ? 'always' : 'never'}"' instead`
552552
);
553553

554554
this.keyboardWillOpenTo = null;

Libraries/Components/Touchable/TouchableHighlight.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ const PRESS_RETENTION_OFFSET = {top: 20, left: 20, right: 20, bottom: 30};
138138
*
139139
* AppRegistry.registerComponent('App', () => App)
140140
* ```
141-
*
141+
*
142142
*/
143143

144144
var TouchableHighlight = createReactClass({

Libraries/Components/WebView/WebView.ios.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ class WebView extends React.Component {
377377
'always',
378378
'compatibility'
379379
]),
380-
380+
381381
/**
382382
* Override the native component used to render the WebView. Enables a custom native
383383
* WebView which uses the same JavaScript as the original WebView.

Libraries/Core/Devtools/symbolicateStackTrace.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const getDevServer = require('getDevServer');
1616
const {SourceCode} = require('NativeModules');
1717

1818
// Avoid requiring fetch on load of this module; see symbolicateStackTrace
19-
let fetch;
19+
let fetch;
2020

2121
import type {StackFrame} from 'parseErrorStack';
2222

@@ -25,13 +25,13 @@ function isSourcedFromDisk(sourcePath: string): boolean {
2525
}
2626

2727
async function symbolicateStackTrace(stack: Array<StackFrame>): Promise<Array<StackFrame>> {
28-
// RN currently lazy loads whatwg-fetch using a custom fetch module, which,
28+
// RN currently lazy loads whatwg-fetch using a custom fetch module, which,
2929
// when called for the first time, requires and re-exports 'whatwg-fetch'.
30-
// However, when a dependency of the project tries to require whatwg-fetch
31-
// either directly or indirectly, whatwg-fetch is required before
30+
// However, when a dependency of the project tries to require whatwg-fetch
31+
// either directly or indirectly, whatwg-fetch is required before
3232
// RN can lazy load whatwg-fetch. As whatwg-fetch checks
33-
// for a fetch polyfill before loading, it will in turn try to load
34-
// RN's fetch module, which immediately tries to import whatwg-fetch AGAIN.
33+
// for a fetch polyfill before loading, it will in turn try to load
34+
// RN's fetch module, which immediately tries to import whatwg-fetch AGAIN.
3535
// This causes a circular require which results in RN's fetch module
3636
// exporting fetch as 'undefined'.
3737
// The fix below postpones trying to load fetch until the first call to symbolicateStackTrace.

Libraries/Utilities/Dimensions.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class Dimensions {
107107
handler: Function
108108
) {
109109
invariant(
110-
'change' === type,
110+
type === 'change',
111111
'Trying to subscribe to unknown event: "%s"', type
112112
);
113113
eventEmitter.addListener(type, handler);
@@ -121,7 +121,7 @@ class Dimensions {
121121
handler: Function
122122
) {
123123
invariant(
124-
'change' === type,
124+
type === 'change',
125125
'Trying to remove listener for unknown event: "%s"', type
126126
);
127127
eventEmitter.removeListener(type, handler);

Libraries/Utilities/PixelRatio.js

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,33 +29,33 @@ var Dimensions = require('Dimensions');
2929
* });
3030
* <Image source={image} style={{width: 200, height: 100}} />
3131
* ```
32-
*
32+
*
3333
* ## Pixel grid snapping
34-
*
35-
* In iOS, you can specify positions and dimensions for elements with arbitrary
34+
*
35+
* In iOS, you can specify positions and dimensions for elements with arbitrary
3636
* precision, for example 29.674825. But, ultimately the physical display only
3737
* have a fixed number of pixels, for example 640×960 for iPhone 4 or 750×1334
38-
* for iPhone 6. iOS tries to be as faithful as possible to the user value by
39-
* spreading one original pixel into multiple ones to trick the eye. The
40-
* downside of this technique is that it makes the resulting element look
38+
* for iPhone 6. iOS tries to be as faithful as possible to the user value by
39+
* spreading one original pixel into multiple ones to trick the eye. The
40+
* downside of this technique is that it makes the resulting element look
4141
* blurry.
42-
*
43-
* In practice, we found out that developers do not want this feature and they
44-
* have to work around it by doing manual rounding in order to avoid having
45-
* blurry elements. In React Native, we are rounding all the pixels
42+
*
43+
* In practice, we found out that developers do not want this feature and they
44+
* have to work around it by doing manual rounding in order to avoid having
45+
* blurry elements. In React Native, we are rounding all the pixels
4646
* automatically.
47-
*
48-
* We have to be careful when to do this rounding. You never want to work with
49-
* rounded and unrounded values at the same time as you're going to accumulate
50-
* rounding errors. Having even one rounding error is deadly because a one
47+
*
48+
* We have to be careful when to do this rounding. You never want to work with
49+
* rounded and unrounded values at the same time as you're going to accumulate
50+
* rounding errors. Having even one rounding error is deadly because a one
5151
* pixel border may vanish or be twice as big.
52-
*
52+
*
5353
* In React Native, everything in JavaScript and within the layout engine works
54-
* with arbitrary precision numbers. It's only when we set the position and
55-
* dimensions of the native element on the main thread that we round. Also,
56-
* rounding is done relative to the root rather than the parent, again to avoid
54+
* with arbitrary precision numbers. It's only when we set the position and
55+
* dimensions of the native element on the main thread that we round. Also,
56+
* rounding is done relative to the root rather than the parent, again to avoid
5757
* accumulating rounding errors.
58-
*
58+
*
5959
*/
6060
class PixelRatio {
6161
/**

Libraries/Utilities/RCTLog.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ const RCTLog = {
5151
setWarningHandler(handler: typeof warningHandler): void {
5252
warningHandler = handler;
5353
}
54-
}
54+
};
5555

5656
module.exports = RCTLog;

0 commit comments

Comments
 (0)