From 08038080d5adc1404e62e37f33f81b6f291c1b45 Mon Sep 17 00:00:00 2001 From: Sean Brennan Date: Sun, 6 Sep 2015 11:17:23 -0700 Subject: [PATCH] fix(SearchBox): clean up eslint issues --- src/SearchBox.js | 4 ++-- src/creators/SearchBoxCreator.js | 10 +++++----- src/eventLists/SearchBoxEventList.js | 2 +- src/utils/componentLifecycleDecorator.js | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/SearchBox.js b/src/SearchBox.js index d9b245b2..346b4ec9 100644 --- a/src/SearchBox.js +++ b/src/SearchBox.js @@ -18,7 +18,7 @@ export default class SearchBox extends Component { // Controlled [props] - used in componentDidMount/componentDidUpdate ...searchBoxControlledPropTypes, // Event [onEventName] - ...searchBoxEventPropTypes + ...searchBoxEventPropTypes, } // Public APIs @@ -54,7 +54,7 @@ export default class SearchBox extends Component { this.setState({ inputElement: domEl, - searchBox: searchBox + searchBox: searchBox, }); } diff --git a/src/creators/SearchBoxCreator.js b/src/creators/SearchBoxCreator.js index 9a1963ac..cc7efaf2 100644 --- a/src/creators/SearchBoxCreator.js +++ b/src/creators/SearchBoxCreator.js @@ -13,13 +13,13 @@ import {default as componentLifecycleDecorator} from "../utils/componentLifecycl import {default as GoogleMapHolder} from "./GoogleMapHolder"; export const searchBoxControlledPropTypes = { - bounds: PropTypes.any + bounds: PropTypes.any, }; export const searchBoxDefaultPropTypes = defaultPropsCreator(searchBoxControlledPropTypes); const searchBoxUpdaters = { - bounds (bounds, component) { component.getSearchBox().setBounds(bounds); } + bounds (bounds, component) { component.getSearchBox().setBounds(bounds); }, }; const {eventPropTypes, registerEvents} = eventHandlerCreator(SearchBoxEventList); @@ -29,18 +29,18 @@ export const searchBoxEventPropTypes = eventPropTypes; @componentLifecycleDecorator({ registerEvents, instanceMethodName: "getSearchBox", - updaters: searchBoxUpdaters + updaters: searchBoxUpdaters, }) export default class SearchBoxCreator extends Component { static propTypes = { mapHolderRef: PropTypes.instanceOf(GoogleMapHolder).isRequired, - searchBox: PropTypes.object.isRequired + searchBox: PropTypes.object.isRequired, } static _createSearchBox (inputElement, searchBoxProps) { const searchBox = new google.maps.places.SearchBox(inputElement, composeOptions(searchBoxProps, [ - "bounds" + "bounds", ])); return searchBox; diff --git a/src/eventLists/SearchBoxEventList.js b/src/eventLists/SearchBoxEventList.js index 68bde2bb..5d44e188 100644 --- a/src/eventLists/SearchBoxEventList.js +++ b/src/eventLists/SearchBoxEventList.js @@ -1,5 +1,5 @@ // https://developers.google.com/maps/documentation/javascript/3.exp/reference#SearchBox // [].map.call($0.querySelectorAll("tr>td>code"), function(it){ return it.textContent; }) export default [ - "places_changed" + "places_changed", ]; \ No newline at end of file diff --git a/src/utils/componentLifecycleDecorator.js b/src/utils/componentLifecycleDecorator.js index cc329d45..57e9b870 100644 --- a/src/utils/componentLifecycleDecorator.js +++ b/src/utils/componentLifecycleDecorator.js @@ -25,7 +25,7 @@ export default function componentLifecycleDecorator ({registerEvents, instanceMe writable: true, value: function () { // Hook into client's implementation, if it has any - if (componentDidMount !== null) { + if (null !== componentDidMount) { componentDidMount.call(this); } @@ -47,7 +47,7 @@ export default function componentLifecycleDecorator ({registerEvents, instanceMe } // Hook into client's implementation, if it has any - if (componentDidUpdate !== null) { + if (null !== componentDidUpdate) { componentDidUpdate.call(this, prevProps); } @@ -61,7 +61,7 @@ export default function componentLifecycleDecorator ({registerEvents, instanceMe writable: true, value () { // Hook into client's implementation, if it has any - if (componentWillUnmount !== null) { + if (null !== componentWillUnmount) { componentWillUnmount.call(this); }