Skip to content

Commit 11a495c

Browse files
elicwhitefacebook-github-bot
authored andcommitted
Fixing eslint-comments warnings
Reviewed By: yungsters Differential Revision: D6678252 fbshipit-source-id: ee93b7ee52520b750ca11fcc625cccf3cd82d075
1 parent a1a0a69 commit 11a495c

File tree

19 files changed

+83
-70
lines changed

19 files changed

+83
-70
lines changed

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

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
* --package - com.facebook.react.tests
2121
* --retries [num] - how many times to retry possible flaky commands: npm install and running tests, default 1
2222
*/
23-
/*eslint-disable no-undef */
2423

2524
const argv = require('yargs').argv;
2625
const async = require('async');

Libraries/Animated/src/__tests__/bezier-test.js

+74-42
Original file line numberDiff line numberDiff line change
@@ -5,100 +5,132 @@
55
* @copyright 2014-2015 Gaetan Renaudeau. MIT License.
66
* @noflow
77
* @emails oncall+react_native
8+
* @format
89
*/
910

10-
/* eslint-disable */
11-
1211
'use strict';
1312

1413
var bezier = require('bezier');
1514

16-
var identity = function (x) { return x; };
15+
var identity = function(x) {
16+
return x;
17+
};
1718

18-
function assertClose (a, b, precision = 3) {
19+
function assertClose(a, b, precision = 3) {
1920
expect(a).toBeCloseTo(b, precision);
2021
}
2122

22-
function makeAssertCloseWithPrecision (precision) {
23-
return function (a, b) {
23+
function makeAssertCloseWithPrecision(precision) {
24+
return function(a, b) {
2425
assertClose(a, b, precision);
2526
};
2627
}
2728

28-
function allEquals (be1, be2, samples, assertion) {
29-
if (!assertion) assertion = assertClose;
30-
for (var i=0; i<=samples; ++i) {
29+
function allEquals(be1, be2, samples, assertion) {
30+
if (!assertion) {
31+
assertion = assertClose;
32+
}
33+
for (var i = 0; i <= samples; ++i) {
3134
var x = i / samples;
3235
assertion(be1(x), be2(x));
3336
}
3437
}
3538

36-
function repeat (n) {
37-
return function (f) {
38-
for (var i=0; i<n; ++i) f(i);
39+
function repeat(n) {
40+
return function(f) {
41+
for (var i = 0; i < n; ++i) {
42+
f(i);
43+
}
3944
};
4045
}
4146

42-
describe('bezier', function(){
43-
it('should be a function', function(){
47+
describe('bezier', function() {
48+
it('should be a function', function() {
4449
expect(typeof bezier === 'function').toBe(true);
4550
});
46-
it('should creates an object', function(){
51+
it('should creates an object', function() {
4752
expect(typeof bezier(0, 0, 1, 1) === 'function').toBe(true);
4853
});
49-
it('should fail with wrong arguments', function () {
50-
expect(function () { bezier(0.5, 0.5, -5, 0.5); }).toThrow();
51-
expect(function () { bezier(0.5, 0.5, 5, 0.5); }).toThrow();
52-
expect(function () { bezier(-2, 0.5, 0.5, 0.5); }).toThrow();
53-
expect(function () { bezier(2, 0.5, 0.5, 0.5); }).toThrow();
54+
it('should fail with wrong arguments', function() {
55+
expect(function() {
56+
bezier(0.5, 0.5, -5, 0.5);
57+
}).toThrow();
58+
expect(function() {
59+
bezier(0.5, 0.5, 5, 0.5);
60+
}).toThrow();
61+
expect(function() {
62+
bezier(-2, 0.5, 0.5, 0.5);
63+
}).toThrow();
64+
expect(function() {
65+
bezier(2, 0.5, 0.5, 0.5);
66+
}).toThrow();
5467
});
55-
describe('linear curves', function () {
56-
it('should be linear', function () {
68+
describe('linear curves', function() {
69+
it('should be linear', function() {
5770
allEquals(bezier(0, 0, 1, 1), bezier(1, 1, 0, 0), 100);
5871
allEquals(bezier(0, 0, 1, 1), identity, 100);
5972
});
6073
});
61-
describe('common properties', function () {
62-
it('should be the right value at extremes', function () {
63-
repeat(10)(function () {
64-
var a = Math.random(), b = 2*Math.random()-0.5, c = Math.random(), d = 2*Math.random()-0.5;
74+
describe('common properties', function() {
75+
it('should be the right value at extremes', function() {
76+
repeat(10)(function() {
77+
var a = Math.random(),
78+
b = 2 * Math.random() - 0.5,
79+
c = Math.random(),
80+
d = 2 * Math.random() - 0.5;
6581
var easing = bezier(a, b, c, d);
6682
expect(easing(0)).toBe(0);
6783
expect(easing(1)).toBe(1);
6884
});
6985
});
7086

71-
it('should approach the projected value of its x=y projected curve', function () {
72-
repeat(10)(function () {
73-
var a = Math.random(), b = Math.random(), c = Math.random(), d = Math.random();
87+
it('should approach the projected value of its x=y projected curve', function() {
88+
repeat(10)(function() {
89+
var a = Math.random(),
90+
b = Math.random(),
91+
c = Math.random(),
92+
d = Math.random();
7493
var easing = bezier(a, b, c, d);
7594
var projected = bezier(b, a, d, c);
76-
var composed = function (x) { return projected(easing(x)); };
95+
var composed = function(x) {
96+
return projected(easing(x));
97+
};
7798
allEquals(identity, composed, 100, makeAssertCloseWithPrecision(2));
7899
});
79100
});
80101
});
81-
describe('two same instances', function () {
82-
it('should be strictly equals', function () {
83-
repeat(10)(function () {
84-
var a = Math.random(), b = 2*Math.random()-0.5, c = Math.random(), d = 2*Math.random()-0.5;
102+
describe('two same instances', function() {
103+
it('should be strictly equals', function() {
104+
repeat(10)(function() {
105+
var a = Math.random(),
106+
b = 2 * Math.random() - 0.5,
107+
c = Math.random(),
108+
d = 2 * Math.random() - 0.5;
85109
allEquals(bezier(a, b, c, d), bezier(a, b, c, d), 100, 0);
86110
});
87111
});
88112
});
89-
describe('symetric curves', function () {
90-
it('should have a central value y~=0.5 at x=0.5', function () {
91-
repeat(10)(function () {
92-
var a = Math.random(), b = 2*Math.random()-0.5, c = 1-a, d = 1-b;
113+
describe('symetric curves', function() {
114+
it('should have a central value y~=0.5 at x=0.5', function() {
115+
repeat(10)(function() {
116+
var a = Math.random(),
117+
b = 2 * Math.random() - 0.5,
118+
c = 1 - a,
119+
d = 1 - b;
93120
var easing = bezier(a, b, c, d);
94121
assertClose(easing(0.5), 0.5, 2);
95122
});
96123
});
97-
it('should be symetrical', function () {
98-
repeat(10)(function () {
99-
var a = Math.random(), b = 2*Math.random()-0.5, c = 1-a, d = 1-b;
124+
it('should be symetrical', function() {
125+
repeat(10)(function() {
126+
var a = Math.random(),
127+
b = 2 * Math.random() - 0.5,
128+
c = 1 - a,
129+
d = 1 - b;
100130
var easing = bezier(a, b, c, d);
101-
var sym = function (x) { return 1 - easing(1-x); };
131+
var sym = function(x) {
132+
return 1 - easing(1 - x);
133+
};
102134
allEquals(easing, sym, 100, makeAssertCloseWithPrecision(2));
103135
});
104136
});

Libraries/Components/ScrollView/ScrollView.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ const ScrollView = createReactClass({
611611
_handleScroll: function(e: Object) {
612612
if (__DEV__) {
613613
if (this.props.onScroll && this.props.scrollEventThrottle == null && Platform.OS === 'ios') {
614-
console.log( // eslint-disable-line no-console
614+
console.log(
615615
'You specified `onScroll` on a <ScrollView> but not ' +
616616
'`scrollEventThrottle`. You will only receive one event. ' +
617617
'Using `16` you get all the events but be aware that it may ' +

Libraries/Core/InitializeCore.js

-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
* @flow
1111
*/
1212

13-
/* eslint-disable strict */
1413
/* globals window: true */
1514

1615
/**
@@ -115,9 +114,7 @@ if (!global.__fbDisableExceptionsManager) {
115114
try {
116115
ExceptionsManager.handleException(e, isFatal);
117116
} catch (ee) {
118-
/* eslint-disable no-console */
119117
console.log('Failed to print error: ', ee.message);
120-
/* eslint-enable no-console */
121118
throw e;
122119
}
123120
};

Libraries/Inspector/Inspector.js

-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
* @flow
1111
*/
1212

13-
/* eslint-disable dot-notation, no-dimensions-get-window */
14-
1513
'use strict';
1614

1715
const Dimensions = require('Dimensions');

Libraries/Lists/FillRateHelper.js

-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
* @format
1212
*/
1313

14-
/* eslint-disable no-console */
15-
1614
'use strict';
1715

1816
/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an error

Libraries/Network/fetch.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*/
1212

13-
/* eslint-disable */
13+
/* globals Headers, Request, Response */
1414

1515
'use strict';
1616

Libraries/Utilities/infoLog.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* Intentional info-level logging for clear separation from ad-hoc console debug logging.
1515
*/
1616
function infoLog(...args) {
17-
return console.log(...args); // eslint-disable-line no-console
17+
return console.log(...args);
1818
}
1919

2020
module.exports = infoLog;

Libraries/polyfills/Array.es6.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* @nolint
1212
*/
1313

14-
/* eslint-disable */
14+
/* eslint-disable consistent-this */
1515

1616
/**
1717
* Creates an array from array like objects.

Libraries/polyfills/Array.prototype.es6.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* @nolint
1212
*/
1313

14-
/* eslint-disable */
14+
/* eslint-disable no-bitwise, no-extend-native, radix, no-self-compare */
1515

1616
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex
1717
function findIndex(predicate, context) {

Libraries/polyfills/Number.es6.js

-3
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
* @nolint
1212
*/
1313

14-
/* eslint-disable strict */
15-
1614
if (Number.EPSILON === undefined) {
1715
Object.defineProperty(Number, 'EPSILON', {
1816
value: Math.pow(2, -52),
@@ -29,7 +27,6 @@ if (Number.MIN_SAFE_INTEGER === undefined) {
2927
});
3028
}
3129
if (!Number.isNaN) {
32-
// eslint-disable-next-line max-len
3330
// https://github.com/dherman/tc39-codex-wiki/blob/master/data/es6/number/index.md#polyfill-for-numberisnan
3431
const globalIsNaN = global.isNaN;
3532
Object.defineProperty(Number, 'isNaN', {

Libraries/polyfills/Object.es6.js

-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
* @nolint
1212
*/
1313

14-
/* eslint-disable strict */
15-
1614
// WARNING: This is an optimized version that fails on hasOwnProperty checks
1715
// and non objects. It's not spec-compliant. It's a perf optimization.
1816
// This is only needed for iOS 8 and current Android JSC.

Libraries/polyfills/String.prototype.es6.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* @nolint
1212
*/
1313

14-
/* eslint-disable strict, no-extend-native, no-bitwise */
14+
/* eslint-disable no-extend-native, no-bitwise */
1515

1616
/*
1717
* NOTE: We use (Number(x) || 0) to replace NaN values with zero.

Libraries/polyfills/__tests__/Object.es7-test.js

-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
* @emails oncall+jsinfra
1010
*/
1111

12-
/* eslint-disable fb-www/object-create-only-one-param */
13-
1412
'use strict';
1513

1614
describe('Object (ES7)', () => {

Libraries/polyfills/babelHelpers.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* @nolint
1212
*/
1313

14-
/* eslint-disable */
14+
/* eslint-disable quotes, curly, no-proto, no-undef-init, dot-notation */
1515

1616
// Created by running:
1717
// require('babel-core').buildExternalHelpers('_extends classCallCheck createClass createRawReactElement defineProperty get inherits interopRequireDefault interopRequireWildcard objectWithoutProperties possibleConstructorReturn slicedToArray taggedTemplateLiteral toArray toConsumableArray '.split(' '))

Libraries/polyfills/console.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* @format
1313
*/
1414

15-
/* eslint-disable */
15+
/* eslint-disable no-shadow, eqeqeq, curly, no-unused-vars, no-void */
1616

1717
/**
1818
* This pipes all of our console logging functions to native logging so that

Libraries/polyfills/error-guard.js

-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
* @nolint
1212
*/
1313

14-
/* eslint-disable strict */
15-
1614
let _inGuard = 0;
1715

1816
/**

RNTester/js/WebViewExample.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ class MessagingTest extends React.Component<{}, $FlowFixMeState> {
256256
class InjectJS extends React.Component<{}> {
257257
webview = null;
258258
injectJS = () => {
259-
const script = 'document.write("Injected JS ")'; // eslint-disable-line quotes
259+
const script = 'document.write("Injected JS ")';
260260
if (this.webview) {
261261
this.webview.injectJavaScript(script);
262262
}

local-cli/__tests__/fs-mock-test.js

-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313

1414
'use strict';
1515

16-
/* eslint-disable no-unclear-flowtypes */
17-
1816
declare var jest: any;
1917
declare var describe: any;
2018
declare var beforeEach: any;

0 commit comments

Comments
 (0)