From 8987522a2af58662903422df0301a70694a2a5e1 Mon Sep 17 00:00:00 2001 From: chico Date: Sun, 1 Nov 2015 04:36:12 +0300 Subject: [PATCH 1/3] remove eslint-disable when possible and update eslint version --- Gruntfile.js | 6 ++---- grunt/config/{compare_size.js => compare-size.js} | 0 grunt/tasks/jsx.js | 2 +- package.json | 2 +- src/isomorphic/classic/class/ReactClass.js | 2 -- src/renderers/dom/client/validateDOMNesting.js | 2 -- .../__tests__/ResponderEventPlugin-test.js | 15 +++++++-------- 7 files changed, 11 insertions(+), 18 deletions(-) rename grunt/config/{compare_size.js => compare-size.js} (100%) diff --git a/Gruntfile.js b/Gruntfile.js index 570e18f709..9921e29f9d 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -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')); @@ -135,7 +133,7 @@ module.exports = function(grunt) { 'npm-react-dom:pack', 'npm-react-addons:release', 'npm-react-addons:pack', - 'compare_size', + 'compare-size', ]); // Automate the release! diff --git a/grunt/config/compare_size.js b/grunt/config/compare-size.js similarity index 100% rename from grunt/config/compare_size.js rename to grunt/config/compare-size.js diff --git a/grunt/tasks/jsx.js b/grunt/tasks/jsx.js index 3132114db3..85e24f6f88 100644 --- a/grunt/tasks/jsx.js +++ b/grunt/tasks/jsx.js @@ -26,7 +26,7 @@ module.exports = function() { }); args.push.apply(args, rootIDs); - args.push('--config' /* from stdin */); + args.push('--config'/* from stdin */); var child = spawn({ cmd: 'node', diff --git a/package.json b/package.json index 39af9e80aa..4c35d13be1 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/isomorphic/classic/class/ReactClass.js b/src/isomorphic/classic/class/ReactClass.js index 4acab6b64c..c606d625c2 100644 --- a/src/isomorphic/classic/class/ReactClass.js +++ b/src/isomorphic/classic/class/ReactClass.js @@ -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; diff --git a/src/renderers/dom/client/validateDOMNesting.js b/src/renderers/dom/client/validateDOMNesting.js index 13e5be2212..d853990b01 100644 --- a/src/renderers/dom/client/validateDOMNesting.js +++ b/src/renderers/dom/client/validateDOMNesting.js @@ -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(); diff --git a/src/renderers/shared/event/eventPlugins/__tests__/ResponderEventPlugin-test.js b/src/renderers/shared/event/eventPlugins/__tests__/ResponderEventPlugin-test.js index e9a640e6d3..a4803c0b10 100644 --- a/src/renderers/shared/event/eventPlugins/__tests__/ResponderEventPlugin-test.js +++ b/src/renderers/shared/event/eventPlugins/__tests__/ResponderEventPlugin-test.js @@ -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; From 4a7456a136111513584d4ac11f9a93af62f3a444 Mon Sep 17 00:00:00 2001 From: chico Date: Thu, 5 Nov 2015 05:08:54 +0300 Subject: [PATCH 2/3] review fixes --- Gruntfile.js | 4 ++-- grunt/config/{compare-size.js => compare_size.js} | 0 grunt/tasks/jsx.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename grunt/config/{compare-size.js => compare_size.js} (100%) diff --git a/Gruntfile.js b/Gruntfile.js index 9921e29f9d..e04bf05524 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -23,7 +23,7 @@ module.exports = function(grunt) { './examples/shared/*.js', '.module-cache', ], - 'compare-size': require('./grunt/config/compare-size'), + 'compare_size': require('./grunt/config/compare_size'), }); grunt.config.set('compress', require('./grunt/config/compress')); @@ -133,7 +133,7 @@ module.exports = function(grunt) { 'npm-react-dom:pack', 'npm-react-addons:release', 'npm-react-addons:pack', - 'compare-size', + 'compare_size', ]); // Automate the release! diff --git a/grunt/config/compare-size.js b/grunt/config/compare_size.js similarity index 100% rename from grunt/config/compare-size.js rename to grunt/config/compare_size.js diff --git a/grunt/tasks/jsx.js b/grunt/tasks/jsx.js index 85e24f6f88..d2140bdcdb 100644 --- a/grunt/tasks/jsx.js +++ b/grunt/tasks/jsx.js @@ -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', From b9fd77a4bd2c4a6103003162f5e9002efcbef6b1 Mon Sep 17 00:00:00 2001 From: chico Date: Thu, 5 Nov 2015 05:14:51 +0300 Subject: [PATCH 3/3] update eslint and eslint-plugin-react --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 4c35d13be1..cb962cffca 100644 --- a/package.json +++ b/package.json @@ -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",