From af8ad59a5b5cef224c1357df9a89a5d35eecef4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20O=E2=80=99Shannessy?= Date: Thu, 12 Feb 2015 14:28:01 -0800 Subject: [PATCH 1/4] Add space-before-blocks rules, fix code --- src/.eslintrc | 1 + src/browser/ReactBrowserEventEmitter.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/.eslintrc b/src/.eslintrc index 699a6b7c936..6c839baeb55 100644 --- a/src/.eslintrc +++ b/src/.eslintrc @@ -25,6 +25,7 @@ rules: consistent-return: 2 no-unused-vars: [2, args: none] quotes: [2, 'single'] + space-before-blocks: 2 # WARNINGS # This is the only one that's hard to track since we don't lint just changes. diff --git a/src/browser/ReactBrowserEventEmitter.js b/src/browser/ReactBrowserEventEmitter.js index 08decd01878..923e4d7ad8d 100644 --- a/src/browser/ReactBrowserEventEmitter.js +++ b/src/browser/ReactBrowserEventEmitter.js @@ -328,7 +328,7 @@ var ReactBrowserEventEmitter = assign({}, ReactEventEmitterMixin, { * * @see http://www.quirksmode.org/dom/events/scroll.html */ - ensureScrollValueMonitoring: function(){ + ensureScrollValueMonitoring: function() { if (!isMonitoringScrollValue) { var refresh = ViewportMetrics.refreshScrollValues; ReactBrowserEventEmitter.ReactEventListener.monitorScrollValue(refresh); From 12808e81c18ca8e9921b606cc680f30cca0a5bab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20O=E2=80=99Shannessy?= Date: Thu, 12 Feb 2015 14:28:32 -0800 Subject: [PATCH 2/4] Fix license header to use BSD --- src/browser/ui/dom/setTextContent.js | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/browser/ui/dom/setTextContent.js b/src/browser/ui/dom/setTextContent.js index 75cbeb046fe..0efbabe1621 100644 --- a/src/browser/ui/dom/setTextContent.js +++ b/src/browser/ui/dom/setTextContent.js @@ -1,17 +1,10 @@ /** - * Copyright 2013-2014 Facebook, Inc. + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule setTextContent */ From 52b32d83d0a85540eebe5caafd5409fc028c7ba2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20O=E2=80=99Shannessy?= Date: Thu, 12 Feb 2015 14:28:54 -0800 Subject: [PATCH 3/4] Remove newline at beginning of file --- src/browser/ui/dom/components/__tests__/ReactDOMIframe-test.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/browser/ui/dom/components/__tests__/ReactDOMIframe-test.js b/src/browser/ui/dom/components/__tests__/ReactDOMIframe-test.js index be455ad24b7..22706a4bebe 100644 --- a/src/browser/ui/dom/components/__tests__/ReactDOMIframe-test.js +++ b/src/browser/ui/dom/components/__tests__/ReactDOMIframe-test.js @@ -1,4 +1,3 @@ - /** * Copyright 2013-2014, Facebook, Inc. * All rights reserved. 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 4/4] 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 6c839baeb55..95227898fa4 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 41dfd39255e..37b11051ccd 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 2676b00aca5..d7b5e19e752 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 5949e960316..50cc56e2c7f 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) {