diff --git a/.eslintrc b/.eslintrc index da893862d..84045365c 100644 --- a/.eslintrc +++ b/.eslintrc @@ -168,7 +168,7 @@ "no-underscore-dangle": 0, // disallow dangling underscores in identifiers "no-wrap-func": 1, // disallow wrapping of non-IIFE statements in parens "no-mixed-spaces-and-tabs": 1, // disallow mixed spaces and tabs for indentation - "quotes": [1, "single"], // specify whether double or single quotes should be used + "quotes": [1, "single", "avoid-escape"], // specify whether double or single quotes should be used "quote-props": 0, // require quotes around object literal property names (off by default) "semi": 1, // require or disallow use of semicolons instead of ASI "sort-vars": 0, // sort variables within the same declaration block (off by default) diff --git a/Libraries/Components/ActivityIndicatorIOS/ActivityIndicatorIOS.ios.js b/Libraries/Components/ActivityIndicatorIOS/ActivityIndicatorIOS.ios.js index d6afa3e06..c229b60c3 100644 --- a/Libraries/Components/ActivityIndicatorIOS/ActivityIndicatorIOS.ios.js +++ b/Libraries/Components/ActivityIndicatorIOS/ActivityIndicatorIOS.ios.js @@ -12,7 +12,6 @@ 'use strict'; var NativeMethodsMixin = require('NativeMethodsMixin'); -var NativeModules = require('NativeModules'); var PropTypes = require('ReactPropTypes'); var React = require('React'); var StyleSheet = require('StyleSheet'); diff --git a/Libraries/Components/ScrollResponder.js b/Libraries/Components/ScrollResponder.js index 0818a0bf9..94e0850f2 100644 --- a/Libraries/Components/ScrollResponder.js +++ b/Libraries/Components/ScrollResponder.js @@ -183,7 +183,7 @@ var ScrollResponderMixin = { var currentlyFocusedTextInput = TextInputState.currentlyFocusedField(); if (!this.props.keyboardShouldPersistTaps && currentlyFocusedTextInput != null && - e.target != currentlyFocusedTextInput) { + e.target !== currentlyFocusedTextInput) { return true; } return this.scrollResponderIsAnimating(); @@ -244,7 +244,7 @@ var ScrollResponderMixin = { var currentlyFocusedTextInput = TextInputState.currentlyFocusedField(); if (!this.props.keyboardShouldPersistTaps && currentlyFocusedTextInput != null && - e.target != currentlyFocusedTextInput && + e.target !== currentlyFocusedTextInput && !this.state.observedScrollSinceBecomingResponder && !this.state.becameResponderWhileAnimating) { this.props.onScrollResponderKeyboardDismissed && diff --git a/Libraries/Components/Subscribable.js b/Libraries/Components/Subscribable.js index cf9bc773a..8474b2149 100644 --- a/Libraries/Components/Subscribable.js +++ b/Libraries/Components/Subscribable.js @@ -11,7 +11,7 @@ */ 'use strict'; -var EventEmitter = require('EventEmitter'); +import type EventEmitter from 'EventEmitter'; /** * Subscribable provides a mixin for safely subscribing a component to an diff --git a/Libraries/Components/WebView/WebView.android.js b/Libraries/Components/WebView/WebView.android.js index a9ee724fa..18491d52c 100644 --- a/Libraries/Components/WebView/WebView.android.js +++ b/Libraries/Components/WebView/WebView.android.js @@ -75,7 +75,7 @@ var WebView = React.createClass({ errorEvent.code, errorEvent.description); } else if (this.state.viewState !== WebViewState.IDLE) { - console.error("RCTWebView invalid state encountered: " + this.state.loading); + console.error('RCTWebView invalid state encountered: ' + this.state.loading); } var webViewStyles = [styles.container, this.props.style]; @@ -152,7 +152,7 @@ var WebView = React.createClass({ onLoadingError: function(event) { event.persist(); // persist this event because we need to store it - console.error("encountered an error loading page", event.nativeEvent); + console.error('Encountered an error loading page', event.nativeEvent); this.setState({ lastErrorEvent: event.nativeEvent, diff --git a/Libraries/Components/WebView/WebView.ios.js b/Libraries/Components/WebView/WebView.ios.js index de9ff2ef1..83af4a8ad 100644 --- a/Libraries/Components/WebView/WebView.ios.js +++ b/Libraries/Components/WebView/WebView.ios.js @@ -14,7 +14,6 @@ var ActivityIndicatorIOS = require('ActivityIndicatorIOS'); var EdgeInsetsPropType = require('EdgeInsetsPropType'); var React = require('React'); -var ReactNativeViewAttributes = require('ReactNativeViewAttributes'); var StyleSheet = require('StyleSheet'); var Text = require('Text'); var View = require('View'); @@ -198,7 +197,7 @@ var WebView = React.createClass({ onLoadingError: function(event: Event) { event.persist(); // persist this event because we need to store it - console.error("encountered an error loading page", event.nativeEvent); + console.error('Encountered an error loading page', event.nativeEvent); this.setState({ lastErrorEvent: event.nativeEvent, diff --git a/package.json b/package.json index 3fffc5491..d524c1785 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ ], "scripts": { "test": "jest", - "lint": "node linter.js Examples/", + "lint": "node linter.js Examples/ Libraries/Components", "start": "./packager/packager.sh" }, "bin": {