[ReactNative] clean lint for Libraries/Components

This commit is contained in:
Spencer Ahrens 2015-05-18 15:30:17 -07:00
Родитель 33ac55b2bd
Коммит 1c70f33511
7 изменённых файлов: 8 добавлений и 10 удалений

Просмотреть файл

@ -168,7 +168,7 @@
"no-underscore-dangle": 0, // disallow dangling underscores in identifiers "no-underscore-dangle": 0, // disallow dangling underscores in identifiers
"no-wrap-func": 1, // disallow wrapping of non-IIFE statements in parens "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 "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) "quote-props": 0, // require quotes around object literal property names (off by default)
"semi": 1, // require or disallow use of semicolons instead of ASI "semi": 1, // require or disallow use of semicolons instead of ASI
"sort-vars": 0, // sort variables within the same declaration block (off by default) "sort-vars": 0, // sort variables within the same declaration block (off by default)

Просмотреть файл

@ -12,7 +12,6 @@
'use strict'; 'use strict';
var NativeMethodsMixin = require('NativeMethodsMixin'); var NativeMethodsMixin = require('NativeMethodsMixin');
var NativeModules = require('NativeModules');
var PropTypes = require('ReactPropTypes'); var PropTypes = require('ReactPropTypes');
var React = require('React'); var React = require('React');
var StyleSheet = require('StyleSheet'); var StyleSheet = require('StyleSheet');

Просмотреть файл

@ -183,7 +183,7 @@ var ScrollResponderMixin = {
var currentlyFocusedTextInput = TextInputState.currentlyFocusedField(); var currentlyFocusedTextInput = TextInputState.currentlyFocusedField();
if (!this.props.keyboardShouldPersistTaps && if (!this.props.keyboardShouldPersistTaps &&
currentlyFocusedTextInput != null && currentlyFocusedTextInput != null &&
e.target != currentlyFocusedTextInput) { e.target !== currentlyFocusedTextInput) {
return true; return true;
} }
return this.scrollResponderIsAnimating(); return this.scrollResponderIsAnimating();
@ -244,7 +244,7 @@ var ScrollResponderMixin = {
var currentlyFocusedTextInput = TextInputState.currentlyFocusedField(); var currentlyFocusedTextInput = TextInputState.currentlyFocusedField();
if (!this.props.keyboardShouldPersistTaps && if (!this.props.keyboardShouldPersistTaps &&
currentlyFocusedTextInput != null && currentlyFocusedTextInput != null &&
e.target != currentlyFocusedTextInput && e.target !== currentlyFocusedTextInput &&
!this.state.observedScrollSinceBecomingResponder && !this.state.observedScrollSinceBecomingResponder &&
!this.state.becameResponderWhileAnimating) { !this.state.becameResponderWhileAnimating) {
this.props.onScrollResponderKeyboardDismissed && this.props.onScrollResponderKeyboardDismissed &&

Просмотреть файл

@ -11,7 +11,7 @@
*/ */
'use strict'; 'use strict';
var EventEmitter = require('EventEmitter'); import type EventEmitter from 'EventEmitter';
/** /**
* Subscribable provides a mixin for safely subscribing a component to an * Subscribable provides a mixin for safely subscribing a component to an

Просмотреть файл

@ -75,7 +75,7 @@ var WebView = React.createClass({
errorEvent.code, errorEvent.code,
errorEvent.description); errorEvent.description);
} else if (this.state.viewState !== WebViewState.IDLE) { } 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]; var webViewStyles = [styles.container, this.props.style];
@ -152,7 +152,7 @@ var WebView = React.createClass({
onLoadingError: function(event) { onLoadingError: function(event) {
event.persist(); // persist this event because we need to store it 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({ this.setState({
lastErrorEvent: event.nativeEvent, lastErrorEvent: event.nativeEvent,

Просмотреть файл

@ -14,7 +14,6 @@
var ActivityIndicatorIOS = require('ActivityIndicatorIOS'); var ActivityIndicatorIOS = require('ActivityIndicatorIOS');
var EdgeInsetsPropType = require('EdgeInsetsPropType'); var EdgeInsetsPropType = require('EdgeInsetsPropType');
var React = require('React'); var React = require('React');
var ReactNativeViewAttributes = require('ReactNativeViewAttributes');
var StyleSheet = require('StyleSheet'); var StyleSheet = require('StyleSheet');
var Text = require('Text'); var Text = require('Text');
var View = require('View'); var View = require('View');
@ -198,7 +197,7 @@ var WebView = React.createClass({
onLoadingError: function(event: Event) { onLoadingError: function(event: Event) {
event.persist(); // persist this event because we need to store it 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({ this.setState({
lastErrorEvent: event.nativeEvent, lastErrorEvent: event.nativeEvent,

Просмотреть файл

@ -36,7 +36,7 @@
], ],
"scripts": { "scripts": {
"test": "jest", "test": "jest",
"lint": "node linter.js Examples/", "lint": "node linter.js Examples/ Libraries/Components",
"start": "./packager/packager.sh" "start": "./packager/packager.sh"
}, },
"bin": { "bin": {