Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run eslint --fix #16229

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions ContainerShip/scripts/run-android-ci-instrumentation-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const test_opts = {

OFFSET: argv.offset,
COUNT: argv.count
}
};

let max_test_class_length = Number.NEGATIVE_INFINITY;

Expand Down Expand Up @@ -85,14 +85,14 @@ if (test_opts.COUNT != null && test_opts.OFFSET != null) {
}

return async.mapSeries(testClasses, (clazz, callback) => {
if(clazz.length > max_test_class_length) {
if (clazz.length > max_test_class_length) {
max_test_class_length = clazz.length;
}

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

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

if(code !== 0) {
if (code !== 0) {
return retryCb(new Error(`Process exited with code: ${code}`));
}

Expand Down Expand Up @@ -138,16 +138,16 @@ function print_test_suite_results(results) {
function pad_output(num_chars) {
let i = 0;

while(i < num_chars) {
while (i < num_chars) {
process.stdout.write(' ');
i++;
}
}
results.forEach((test) => {
if(test.status === 'success') {
if (test.status === 'success') {
color = colors.GREEN;
passing_suites++;
} else if(test.status === 'failure') {
} else if (test.status === 'failure') {
color = colors.RED;
failing_suites++;
}
Expand Down
2 changes: 1 addition & 1 deletion IntegrationTests/AsyncStorageTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ function testOptimizedMultiGet() {
let keys = batch.map(([key, value]) => key);
AsyncStorage.multiSet(batch, (err1) => {
// yes, twice on purpose
;[1, 2].forEach((i) => {
[1, 2].forEach((i) => {
expectAsyncNoError(`${i} testOptimizedMultiGet/multiSet`, err1);
AsyncStorage.multiGet(keys, (err2, result) => {
expectAsyncNoError(`${i} testOptimizedMultiGet/multiGet`, err2);
Expand Down
2 changes: 1 addition & 1 deletion IntegrationTests/ImageCachePolicyTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class ImageCachePolicyTest extends React.Component<Props, $FlowFixMeState> {
const results: Array<?boolean> = TESTS.map(x => nextState[x]);

if (!results.includes(undefined)) {
const result: boolean = results.reduce((x,y) => x === y === true, true)
const result: boolean = results.reduce((x,y) => x === y === true, true);
TestModule.markTestPassed(result);
}

Expand Down
2 changes: 1 addition & 1 deletion Libraries/Components/ScrollResponder.js
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ var ScrollResponderMixin = {
warning(
typeof keyboardShouldPersistTaps !== 'boolean',
`'keyboardShouldPersistTaps={${keyboardShouldPersistTaps}}' is deprecated. `
+ `Use 'keyboardShouldPersistTaps="${keyboardShouldPersistTaps ? "always" : "never"}"' instead`
+ `Use 'keyboardShouldPersistTaps="${keyboardShouldPersistTaps ? 'always' : 'never'}"' instead`
);

this.keyboardWillOpenTo = null;
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Components/Touchable/TouchableHighlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ const PRESS_RETENTION_OFFSET = {top: 20, left: 20, right: 20, bottom: 30};
*
* AppRegistry.registerComponent('App', () => App)
* ```
*
*
*/

var TouchableHighlight = createReactClass({
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Components/WebView/WebView.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ class WebView extends React.Component {
'always',
'compatibility'
]),

/**
* Override the native component used to render the WebView. Enables a custom native
* WebView which uses the same JavaScript as the original WebView.
Expand Down
12 changes: 6 additions & 6 deletions Libraries/Core/Devtools/symbolicateStackTrace.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const getDevServer = require('getDevServer');
const {SourceCode} = require('NativeModules');

// Avoid requiring fetch on load of this module; see symbolicateStackTrace
let fetch;
let fetch;

import type {StackFrame} from 'parseErrorStack';

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

async function symbolicateStackTrace(stack: Array<StackFrame>): Promise<Array<StackFrame>> {
// RN currently lazy loads whatwg-fetch using a custom fetch module, which,
// RN currently lazy loads whatwg-fetch using a custom fetch module, which,
// when called for the first time, requires and re-exports 'whatwg-fetch'.
// However, when a dependency of the project tries to require whatwg-fetch
// either directly or indirectly, whatwg-fetch is required before
// However, when a dependency of the project tries to require whatwg-fetch
// either directly or indirectly, whatwg-fetch is required before
// RN can lazy load whatwg-fetch. As whatwg-fetch checks
// for a fetch polyfill before loading, it will in turn try to load
// RN's fetch module, which immediately tries to import whatwg-fetch AGAIN.
// for a fetch polyfill before loading, it will in turn try to load
// RN's fetch module, which immediately tries to import whatwg-fetch AGAIN.
// This causes a circular require which results in RN's fetch module
// exporting fetch as 'undefined'.
// The fix below postpones trying to load fetch until the first call to symbolicateStackTrace.
Expand Down
4 changes: 2 additions & 2 deletions Libraries/Utilities/Dimensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class Dimensions {
handler: Function
) {
invariant(
'change' === type,
type === 'change',
'Trying to subscribe to unknown event: "%s"', type
);
eventEmitter.addListener(type, handler);
Expand All @@ -121,7 +121,7 @@ class Dimensions {
handler: Function
) {
invariant(
'change' === type,
type === 'change',
'Trying to remove listener for unknown event: "%s"', type
);
eventEmitter.removeListener(type, handler);
Expand Down
38 changes: 19 additions & 19 deletions Libraries/Utilities/PixelRatio.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,33 +29,33 @@ var Dimensions = require('Dimensions');
* });
* <Image source={image} style={{width: 200, height: 100}} />
* ```
*
*
* ## Pixel grid snapping
*
* In iOS, you can specify positions and dimensions for elements with arbitrary
*
* In iOS, you can specify positions and dimensions for elements with arbitrary
* precision, for example 29.674825. But, ultimately the physical display only
* have a fixed number of pixels, for example 640×960 for iPhone 4 or 750×1334
* for iPhone 6. iOS tries to be as faithful as possible to the user value by
* spreading one original pixel into multiple ones to trick the eye. The
* downside of this technique is that it makes the resulting element look
* for iPhone 6. iOS tries to be as faithful as possible to the user value by
* spreading one original pixel into multiple ones to trick the eye. The
* downside of this technique is that it makes the resulting element look
* blurry.
*
* In practice, we found out that developers do not want this feature and they
* have to work around it by doing manual rounding in order to avoid having
* blurry elements. In React Native, we are rounding all the pixels
*
* In practice, we found out that developers do not want this feature and they
* have to work around it by doing manual rounding in order to avoid having
* blurry elements. In React Native, we are rounding all the pixels
* automatically.
*
* We have to be careful when to do this rounding. You never want to work with
* rounded and unrounded values at the same time as you're going to accumulate
* rounding errors. Having even one rounding error is deadly because a one
*
* We have to be careful when to do this rounding. You never want to work with
* rounded and unrounded values at the same time as you're going to accumulate
* rounding errors. Having even one rounding error is deadly because a one
* pixel border may vanish or be twice as big.
*
*
* In React Native, everything in JavaScript and within the layout engine works
* with arbitrary precision numbers. It's only when we set the position and
* dimensions of the native element on the main thread that we round. Also,
* rounding is done relative to the root rather than the parent, again to avoid
* with arbitrary precision numbers. It's only when we set the position and
* dimensions of the native element on the main thread that we round. Also,
* rounding is done relative to the root rather than the parent, again to avoid
* accumulating rounding errors.
*
*
*/
class PixelRatio {
/**
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Utilities/RCTLog.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ const RCTLog = {
setWarningHandler(handler: typeof warningHandler): void {
warningHandler = handler;
}
}
};

module.exports = RCTLog;
6 changes: 3 additions & 3 deletions Libraries/Utilities/createStrictShapeTypeChecker.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,16 @@ function createStrictShapeTypeChecker(
invariant(
false,
`Invalid props.${propName} key \`${key}\` supplied to \`${componentName}\`.` +
`\nBad object: ` + JSON.stringify(props[propName], null, ' ') +
`\nValid keys: ` + JSON.stringify(Object.keys(shapeTypes), null, ' ')
'\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
'\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
);
}
var error = checker(propValue, key, componentName, location, ...rest);
if (error) {
invariant(
false,
error.message +
`\nBad object: ` + JSON.stringify(props[propName], null, ' ')
'\nBad object: ' + JSON.stringify(props[propName], null, ' ')
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Vibration/Vibration.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function vibrateScheduler(id, pattern: Array<number>, repeat: boolean, nextIndex
return;
}
}
setTimeout(() => vibrateScheduler(id, pattern, repeat, nextIndex+1), pattern[nextIndex]);
setTimeout(() => vibrateScheduler(id, pattern, repeat, nextIndex + 1), pattern[nextIndex]);
}

var Vibration = {
Expand Down
4 changes: 1 addition & 3 deletions RNTester/js/SwipeableFlatListExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@ const SwipeableFlatListExample = createReactClass({
<View style={styles.row}>
<Image style={styles.rowIcon} source={item.icon} />
<View style={styles.rowData}>
<Text style={styles.rowDataText}>
{item.data}
</Text>
<Text style={styles.rowDataText}>{item.data}</Text>
</View>
</View>
);
Expand Down
2 changes: 1 addition & 1 deletion RNTester/js/TVEventHandlerExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class TVEventHandlerView extends React.Component<$FlowFixMeProps, {
this._tvEventHandler.enable(this, function(cmp, evt) {
cmp.setState({
lastEventType: evt.eventType
})
});
});
}

Expand Down
5 changes: 2 additions & 3 deletions RNTester/js/TextInputExample.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,7 @@ exports.examples = [
<TextInput
defaultValue="Highlight Color is red"
selectionColor={'red'}
style={styles.singleLine}>
</TextInput>
style={styles.singleLine} />
</View>
);
}
Expand Down Expand Up @@ -746,7 +745,7 @@ exports.examples = [
<SelectionExample
multiline
style={styles.multiline}
value={"multiline text selection\ncan also be changed"}
value={'multiline text selection\ncan also be changed'}
/>
</View>
);
Expand Down
6 changes: 3 additions & 3 deletions RNTester/js/TextInputExample.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -610,12 +610,12 @@ exports.examples = [
<View>
<TextInput
style={styles.default}
selectionColor={"green"}
selectionColor={'green'}
defaultValue="Highlight me"
/>
<TextInput
style={styles.default}
selectionColor={"rgba(86, 76, 205, 1)"}
selectionColor={'rgba(86, 76, 205, 1)'}
defaultValue="Highlight me"
/>
</View>
Expand Down Expand Up @@ -872,7 +872,7 @@ exports.examples = [
<SelectionExample
multiline
style={styles.multiline}
value={"multiline text selection\ncan also be changed"}
value={'multiline text selection\ncan also be changed'}
/>
</View>
);
Expand Down
34 changes: 17 additions & 17 deletions ReactAndroid/src/androidTest/js/MeasureLayoutTestModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,29 @@ var assertEquals = require('Asserts').assertEquals;

var styles = StyleSheet.create({
A: {
"width": 500,
"height": 500,
'width': 500,
'height': 500,
},
B: {
backgroundColor: "rgb(255, 0, 0)",
"left": 50,
"top": 80,
"width": 200,
"height": 300,
backgroundColor: 'rgb(255, 0, 0)',
'left': 50,
'top': 80,
'width': 200,
'height': 300,
},
C: {
backgroundColor: "rgb(0, 255, 0)",
"left": 100,
"top": 70,
"width": 50,
"height": 150,
backgroundColor: 'rgb(0, 255, 0)',
'left': 100,
'top': 70,
'width': 50,
'height': 150,
},
D: {
backgroundColor: "rgb(0, 0, 255)",
"left": 400,
"top": 100,
"width": 50,
"height": 200,
backgroundColor: 'rgb(0, 0, 255)',
'left': 400,
'top': 100,
'width': 50,
'height': 200,
},
});

Expand Down
2 changes: 1 addition & 1 deletion ReactAndroid/src/androidTest/js/ProgressBarTestModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @providesModule ProgressBarTestModule
*/

"use strict";
'use strict';

var BatchedBridge = require('BatchedBridge');
var React = require('React');
Expand Down
Loading