Skip to content

Commit

Permalink
[ReactNative] clean lint in all of Libraries/
Browse files Browse the repository at this point in the history
  • Loading branch information
sahrens committed May 19, 2015
1 parent a4f92ba commit 11b515b
Show file tree
Hide file tree
Showing 32 changed files with 36 additions and 49 deletions.
4 changes: 3 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
**/node_modules/**/.*js
# node_modules ignored by default

**/staticBundle.js
**/main.js
Libraries/vendor/**/*
3 changes: 1 addition & 2 deletions Libraries/ART/ARTSerializablePath.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
*
* @providesModule ARTSerializablePath
*/

"use strict";
'use strict';

// TODO: Move this into an ART mode called "serialized" or something

Expand Down
3 changes: 1 addition & 2 deletions Libraries/ART/ReactNativeART.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
*
* @providesModule ReactNativeART
*/

"use strict";
'use strict';

var Color = require('art/core/color');
var Path = require('ARTSerializablePath');
Expand Down
4 changes: 1 addition & 3 deletions Libraries/CustomComponents/Navigator/Navigator.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
*
* @providesModule Navigator
*/
/* eslint-disable no-extra-boolean-cast*/
'use strict';

var AnimationsDebugModule = require('NativeModules').AnimationsDebugModule;
Expand All @@ -48,8 +49,6 @@ var clamp = require('clamp');
var flattenStyle = require('flattenStyle');
var getNavigatorContext = require('getNavigatorContext');
var invariant = require('invariant');
var keyMirror = require('keyMirror');
var merge = require('merge');
var rebound = require('rebound');

var PropTypes = React.PropTypes;
Expand Down Expand Up @@ -745,7 +744,6 @@ var Navigator = React.createClass({
},

_handleMoveShouldSetPanResponder: function(e, gestureState) {
var currentRoute = this.state.routeStack[this.state.presentedIndex];
var sceneConfig = this.state.sceneConfigStack[this.state.presentedIndex];
this._expectingGestureGrant = this._matchGestureAction(this._eligibleGestures, sceneConfig.gestures, gestureState);
return !! this._expectingGestureGrant;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ var FromTheLeft = {
translateX: {
from: -SCREEN_WIDTH,
to: 0,
min: 0,
min: 0,
max: 1,
type: 'linear',
extrapolate: true,
Expand Down
1 change: 1 addition & 0 deletions Libraries/Fetch/fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* @providesModule fetch
* @nolint
*/
/* eslint-disable */
'use strict';

var self = {};
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Geolocation/Geolocation.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,6 @@ var Geolocation = {
subscriptions = [];
}
}
}
};

module.exports = Geolocation;
1 change: 1 addition & 0 deletions Libraries/JavaScriptAppEngine/Initialization/SourceMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* and wrapping resulting file into `wrapper` function.
*
*/
/*eslint-disable */

var scope = {};
wrapper.call(scope);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
*
* @nolint
*/
/* eslint-disable */

(function() {
var define = null; // Hack to make it work with our packager
Expand Down
1 change: 0 additions & 1 deletion Libraries/PushNotificationIOS/PushNotificationIOS.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
*/
'use strict';

var NativeModules = require('NativeModules');
var RCTDeviceEventEmitter = require('RCTDeviceEventEmitter');
var RCTPushNotificationManager = require('NativeModules').PushNotificationManager;
var invariant = require('invariant');
Expand Down
1 change: 0 additions & 1 deletion Libraries/RKBackendNode/queryLayoutByID.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,3 @@ var queryLayoutByID = function(
};

module.exports = queryLayoutByID;

6 changes: 2 additions & 4 deletions Libraries/ReactIOS/IOSNativeBridgeEventPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
* @providesModule IOSNativeBridgeEventPlugin
* @flow
*/

"use strict";
'use strict';

var EventPropagators = require('EventPropagators');
var NativeModules = require('NativeModules');
Expand All @@ -33,7 +32,7 @@ for (var bubblingTypeName in customBubblingEventTypes) {
for (var directTypeName in customDirectEventTypes) {
warning(
!customBubblingEventTypes[directTypeName],
"Event cannot be both direct and bubbling: %s",
'Event cannot be both direct and bubbling: %s',
directTypeName
);
allTypesByEventName[directTypeName] = customDirectEventTypes[directTypeName];
Expand Down Expand Up @@ -76,4 +75,3 @@ var IOSNativeBridgeEventPlugin = {
};

module.exports = IOSNativeBridgeEventPlugin;

3 changes: 1 addition & 2 deletions Libraries/ReactNative/React.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* @providesModule React
* @flow
*/

"use strict";
'use strict';

module.exports = require('ReactNative');
2 changes: 1 addition & 1 deletion Libraries/ReactNative/ReactNative.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @providesModule ReactNative
* @flow
*/
"use strict";
'use strict';

var ReactChildren = require('ReactChildren');
var ReactClass = require('ReactClass');
Expand Down
5 changes: 3 additions & 2 deletions Libraries/ReactNative/ReactNativeBaseComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ var cachedIndexArray = function(size) {
for (var i = 0; i < size; i++) {
arr[i] = i;
}
return cachedIndexArray._cache[size] = arr;
cachedIndexArray._cache[size] = arr;
return arr;
} else {
return cachedResult;
}
Expand Down Expand Up @@ -228,7 +229,7 @@ ReactNativeBaseComponent.Mixin = {
*/
_reconcileListenersUponUpdate: function(prevProps, nextProps) {
for (var key in nextProps) {
if (registrationNames[key] && (nextProps[key] != prevProps[key])) {
if (registrationNames[key] && (nextProps[key] !== prevProps[key])) {
putListener(this._rootNodeID, key, nextProps[key]);
}
}
Expand Down
3 changes: 1 addition & 2 deletions Libraries/ReactNative/ReactNativeDOMIDOperations.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
* @providesModule ReactNativeDOMIDOperations
* @flow
*/

"use strict";
'use strict';

var ReactNativeTagHandles = require('ReactNativeTagHandles');
var ReactMultiChildUpdateTypes = require('ReactMultiChildUpdateTypes');
Expand Down
4 changes: 1 addition & 3 deletions Libraries/ReactNative/ReactNativeDefaultInjection.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
* @providesModule ReactNativeDefaultInjection
* @flow
*/

"use strict";
'use strict';

/**
* Make sure `setTimeout`/`setInterval` are patched correctly.
Expand All @@ -21,7 +20,6 @@ var EventPluginUtils = require('EventPluginUtils');
var IOSDefaultEventPluginOrder = require('IOSDefaultEventPluginOrder');
var IOSNativeBridgeEventPlugin = require('IOSNativeBridgeEventPlugin');
var NodeHandle = require('NodeHandle');
var ReactClass = require('ReactClass');
var ReactComponentEnvironment = require('ReactComponentEnvironment');
var ReactDefaultBatchingStrategy = require('ReactDefaultBatchingStrategy');
var ReactEmptyComponent = require('ReactEmptyComponent');
Expand Down
3 changes: 1 addition & 2 deletions Libraries/ReactNative/ReactNativeEventEmitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
* @providesModule ReactNativeEventEmitter
* @flow
*/

"use strict";
'use strict';

var EventPluginHub = require('EventPluginHub');
var ReactEventEmitterMixin = require('ReactEventEmitterMixin');
Expand Down
1 change: 0 additions & 1 deletion Libraries/ReactNative/ReactNativeMount.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ var ReactUpdates = require('ReactUpdates');

var emptyObject = require('emptyObject');
var instantiateReactComponent = require('instantiateReactComponent');
var invariant = require('invariant');
var shouldUpdateReactComponent = require('shouldUpdateReactComponent');

function instanceNumberToChildRootID(rootNodeID, instanceNumber) {
Expand Down
3 changes: 1 addition & 2 deletions Libraries/ReactNative/ReactNativeReconcileTransaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
* @providesModule ReactNativeReconcileTransaction
* @flow
*/

"use strict";
'use strict';

var CallbackQueue = require('CallbackQueue');
var PooledClass = require('PooledClass');
Expand Down
3 changes: 1 addition & 2 deletions Libraries/ReactNative/createReactNativeComponentClass.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
* @flow
*/

"use strict";
'use strict';

var ReactElement = require('ReactElement');
var ReactNativeBaseComponent = require('ReactNativeBaseComponent');

// See also ReactNativeBaseComponent
Expand Down
11 changes: 5 additions & 6 deletions Libraries/Settings/Settings.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var Settings = {
},

watchKeys(keys: string | Array<string>, callback: Function): number {
if (typeof keys == 'string') {
if (typeof keys === 'string') {
keys = [keys];
}

Expand All @@ -41,7 +41,7 @@ var Settings = {
);

var sid = subscriptions.length;
subscriptions.push({keys: keys, callback: callback})
subscriptions.push({keys: keys, callback: callback});
return sid;
},

Expand All @@ -52,15 +52,14 @@ var Settings = {
},

_sendObservations(body: Object) {
var _this = this;
Object.keys(body).forEach((key) => {
var newValue = body[key];
var didChange = _this._settings[key] !== newValue;
_this._settings[key] = newValue;
var didChange = this._settings[key] !== newValue;
this._settings[key] = newValue;

if (didChange) {
subscriptions.forEach((sub) => {
if (~sub.keys.indexOf(key) && sub.callback) {
if (sub.keys.indexOf(key) !== -1 && sub.callback) {
sub.callback();
}
});
Expand Down
3 changes: 1 addition & 2 deletions Libraries/StyleSheet/EdgeInsetsPropType.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@
* @providesModule EdgeInsetsPropType
* @flow
*/
'use strict'
'use strict';

var PropTypes = require('ReactPropTypes');

var createStrictShapeTypeChecker = require('createStrictShapeTypeChecker');
var insetsDiffer = require('insetsDiffer');

var EdgeInsetsPropType = createStrictShapeTypeChecker({
top: PropTypes.number,
Expand Down
3 changes: 1 addition & 2 deletions Libraries/StyleSheet/PointPropType.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@
* @providesModule PointPropType
* @flow
*/
'use strict'
'use strict';

var PropTypes = require('ReactPropTypes');

var createStrictShapeTypeChecker = require('createStrictShapeTypeChecker');
var pointsDiffer = require('pointsDiffer');

var PointPropType = createStrictShapeTypeChecker({
x: PropTypes.number,
Expand Down
1 change: 1 addition & 0 deletions Libraries/Utilities/ErrorUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*
* @providesModule ErrorUtils
*/
/* eslint-disable consistent-this, global-strict */

var GLOBAL = this;

Expand Down
1 change: 1 addition & 0 deletions Libraries/Utilities/MatrixMath.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*
* @providesModule MatrixMath
*/
/* eslint-disable space-infix-ops */
'use strict';

var invariant = require('invariant');
Expand Down
1 change: 0 additions & 1 deletion Libraries/Utilities/RCTLog.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* @providesModule RCTLog
* @flow
*/
/* globals nativeLoggingHook */
'use strict';

var invariant = require('invariant');
Expand Down
1 change: 0 additions & 1 deletion Libraries/Utilities/RCTRenderingPerf.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
'use strict';

var ReactDefaultPerf = require('ReactDefaultPerf');
var ReactPerf = require('ReactPerf');

var invariant = require('invariant');

Expand Down
2 changes: 1 addition & 1 deletion Libraries/Utilities/__mocks__/ErrorUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

function execute(fun, context, args) {
return fun.apply(context, args);
};
}

function reportError(error) {
throw error;
Expand Down
3 changes: 2 additions & 1 deletion Libraries/Utilities/buildStyleInterpolator.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/**
* Cannot "use strict" because we must use eval in this file.
*/
/* eslint-disable global-strict */

var keyOf = require('keyOf');

Expand Down Expand Up @@ -372,7 +373,7 @@ var MatrixOpsInitial = {
var setNextValAndDetectChange = function(name, tmpVarName) {
return (
' if (!didChange) {\n' +
' var prevVal = result.' + name +';\n' +
' var prevVal = result.' + name + ';\n' +
' result.' + name + ' = ' + tmpVarName + ';\n' +
' didChange = didChange || (' + tmpVarName + ' !== prevVal);\n' +
' } else {\n' +
Expand Down
1 change: 0 additions & 1 deletion Libraries/Utilities/truncate.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,3 @@ var truncate = function(
};

module.exports = truncate;

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
],
"scripts": {
"test": "jest",
"lint": "node linter.js Examples/ Libraries/Components",
"lint": "node linter.js Examples/ Libraries/",
"start": "./packager/packager.sh"
},
"bin": {
Expand Down

0 comments on commit 11b515b

Please sign in to comment.