From 7e5eb4b2b2c2aa503d0db4ec257cbb7bf071783c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20O=E2=80=99Shannessy?= Date: Thu, 12 Feb 2015 14:29:43 -0800 Subject: [PATCH] Add indent lint rule, fix code --- src/.eslintrc | 1 + src/browser/eventPlugins/DefaultEventPluginOrder.js | 2 +- src/browser/ui/ReactDOMIDOperations.js | 4 ++-- src/core/ReactCompositeComponent.js | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/.eslintrc b/src/.eslintrc index 6c839baeb5..95227898fa 100644 --- a/src/.eslintrc +++ b/src/.eslintrc @@ -26,6 +26,7 @@ rules: no-unused-vars: [2, args: none] quotes: [2, 'single'] space-before-blocks: 2 + indent: [2, 2, indentSwitchCase: true] # WARNINGS # This is the only one that's hard to track since we don't lint just changes. diff --git a/src/browser/eventPlugins/DefaultEventPluginOrder.js b/src/browser/eventPlugins/DefaultEventPluginOrder.js index 41dfd39255..37b11051cc 100644 --- a/src/browser/eventPlugins/DefaultEventPluginOrder.js +++ b/src/browser/eventPlugins/DefaultEventPluginOrder.js @@ -11,7 +11,7 @@ 'use strict'; - var keyOf = require('keyOf'); +var keyOf = require('keyOf'); /** * Module that is injectable into `EventPluginHub`, that specifies a diff --git a/src/browser/ui/ReactDOMIDOperations.js b/src/browser/ui/ReactDOMIDOperations.js index 2676b00aca..d7b5e19e75 100644 --- a/src/browser/ui/ReactDOMIDOperations.js +++ b/src/browser/ui/ReactDOMIDOperations.js @@ -132,8 +132,8 @@ var ReactDOMIDOperations = { * @see {Danger.dangerouslyReplaceNodeWithMarkup} */ dangerouslyReplaceNodeWithMarkupByID: function(id, markup) { - var node = ReactMount.getNode(id); - DOMChildrenOperations.dangerouslyReplaceNodeWithMarkup(node, markup); + var node = ReactMount.getNode(id); + DOMChildrenOperations.dangerouslyReplaceNodeWithMarkup(node, markup); }, /** diff --git a/src/core/ReactCompositeComponent.js b/src/core/ReactCompositeComponent.js index 5949e96031..50cc56e2c7 100644 --- a/src/core/ReactCompositeComponent.js +++ b/src/core/ReactCompositeComponent.js @@ -202,7 +202,7 @@ var ReactCompositeComponentMixin = { ReactLifeCycle.currentlyMountingInstance = this; try { if (inst.componentWillMount) { - inst.componentWillMount(); + inst.componentWillMount(); // When mounting, calls to `setState` by `componentWillMount` will set // `this._pendingStateQueue` without triggering a re-render. if (this._pendingStateQueue) {