mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Merge pull request #5352 from chicoxyzzy/eslint-upgrade
remove eslint-disable when possible and update babel-eslint version
This commit is contained in:
+1
-3
@@ -23,9 +23,7 @@ module.exports = function(grunt) {
|
||||
'./examples/shared/*.js',
|
||||
'.module-cache',
|
||||
],
|
||||
/*eslint-disable camelcase */
|
||||
compare_size: require('./grunt/config/compare_size'),
|
||||
/*eslint-enable camelcase */
|
||||
'compare_size': require('./grunt/config/compare_size'),
|
||||
});
|
||||
|
||||
grunt.config.set('compress', require('./grunt/config/compress'));
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ module.exports = function() {
|
||||
});
|
||||
|
||||
args.push.apply(args, rootIDs);
|
||||
args.push('--config' /* from stdin */);
|
||||
args.push('--config');
|
||||
|
||||
var child = spawn({
|
||||
cmd: 'node',
|
||||
|
||||
+3
-3
@@ -4,7 +4,7 @@
|
||||
"version": "0.15.0-alpha",
|
||||
"devDependencies": {
|
||||
"babel": "^5.8.29",
|
||||
"babel-eslint": "4.1.3",
|
||||
"babel-eslint": "4.1.4",
|
||||
"benchmark": "^1.0.0",
|
||||
"browserify": "^12.0.1",
|
||||
"bundle-collapser": "^1.1.1",
|
||||
@@ -12,8 +12,8 @@
|
||||
"del": "^1.2.0",
|
||||
"derequire": "^2.0.3",
|
||||
"envify": "^3.0.0",
|
||||
"eslint": "1.7.3",
|
||||
"eslint-plugin-react": "3.6.3",
|
||||
"eslint": "1.8.0",
|
||||
"eslint-plugin-react": "3.7.0",
|
||||
"eslint-plugin-react-internal": "file:eslint-rules",
|
||||
"fbjs": "^0.4.0",
|
||||
"fbjs-scripts": "^0.3.0",
|
||||
|
||||
@@ -663,7 +663,6 @@ function bindAutoBindMethod(component, method) {
|
||||
boundMethod.__reactBoundArguments = null;
|
||||
var componentName = component.constructor.displayName;
|
||||
var _bind = boundMethod.bind;
|
||||
/* eslint-disable block-scoped-var, no-undef */
|
||||
boundMethod.bind = function(newThis, ...args) {
|
||||
// User is trying to bind() an autobound method; we effectively will
|
||||
// ignore the value of "this" that the user is trying to use, so
|
||||
@@ -690,7 +689,6 @@ function bindAutoBindMethod(component, method) {
|
||||
reboundMethod.__reactBoundMethod = method;
|
||||
reboundMethod.__reactBoundArguments = args;
|
||||
return reboundMethod;
|
||||
/* eslint-enable */
|
||||
};
|
||||
}
|
||||
return boundMethod;
|
||||
|
||||
@@ -310,9 +310,7 @@ if (__DEV__) {
|
||||
}
|
||||
|
||||
var stack = [];
|
||||
/*eslint-disable space-after-keywords */
|
||||
do {
|
||||
/*eslint-enable space-after-keywords */
|
||||
stack.push(instance);
|
||||
} while ((instance = instance._currentElement._owner));
|
||||
stack.reverse();
|
||||
|
||||
@@ -218,7 +218,7 @@ var registerTestHandlers = function(eventTestConfig, readableIDToID) {
|
||||
'\nFor event test config:\n' + JSON.stringify(eventTestConfig) + '\n'
|
||||
);
|
||||
};
|
||||
/*eslint-disable no-loop-func, no-shadow */
|
||||
|
||||
var registerOneEventType = function(registrationName, eventTypeTestConfig) {
|
||||
for (var readableID in eventTypeTestConfig) {
|
||||
var nodeConfig = eventTypeTestConfig[readableID];
|
||||
@@ -226,21 +226,20 @@ var registerTestHandlers = function(eventTestConfig, readableIDToID) {
|
||||
var handler = nodeConfig.order === NA ? neverFire.bind(null, readableID, registrationName) :
|
||||
// We partially apply readableID and nodeConfig, as they change in the
|
||||
// parent closure across iterations.
|
||||
function(readableID, nodeConfig, e) {
|
||||
function(rID, config, e) {
|
||||
expect(
|
||||
readableID + '->' + registrationName + ' index:' + runs.dispatchCount++
|
||||
rID + '->' + registrationName + ' index:' + runs.dispatchCount++
|
||||
).toBe(
|
||||
readableID + '->' + registrationName + ' index:' + nodeConfig.order
|
||||
rID + '->' + registrationName + ' index:' + config.order
|
||||
);
|
||||
if (nodeConfig.assertEvent) {
|
||||
nodeConfig.assertEvent(e);
|
||||
if (config.assertEvent) {
|
||||
config.assertEvent(e);
|
||||
}
|
||||
return nodeConfig.returnVal;
|
||||
return config.returnVal;
|
||||
}.bind(null, readableID, nodeConfig);
|
||||
EventPluginHub.putListener(idToInstance[id], registrationName, handler);
|
||||
}
|
||||
};
|
||||
/*eslint-enable no-loop-func, no-shadow */
|
||||
for (var eventName in eventTestConfig) {
|
||||
var oneEventTypeTestConfig = eventTestConfig[eventName];
|
||||
var hasTwoPhase = !!oneEventTypeTestConfig.bubbled;
|
||||
|
||||
Reference in New Issue
Block a user