From 6525d9d84ad036c2606510835cacbe837e72e4e5 Mon Sep 17 00:00:00 2001 From: Nicolas Gallagher Date: Thu, 25 May 2017 10:40:54 -0700 Subject: [PATCH] Fix lint errors in 'examples' directory --- examples/apis/Clipboard/ClipboardExample.js | 2 +- examples/apis/Linking/LinkingExample.js | 2 +- .../apis/PanResponder/PanResponderExample.js | 16 +- .../ActivityIndicatorExample.js | 26 +- examples/components/Button/ButtonExample.js | 18 +- examples/components/Image/ImageExample.js | 93 +++---- .../ProgressBar/ProgressBarExample.js | 18 +- .../ScrollView/ScrollViewExample.js | 2 + examples/components/Switch/SwitchExample.js | 34 +-- examples/components/Text/TextExample.js | 34 +-- .../components/TextInput/TextInputExample.js | 202 ++++++++------ .../components/Touchable/TouchableExample.js | 248 +++++++++--------- examples/components/View/ViewExample.js | 8 +- .../components/View/ViewTransformsExample.js | 8 +- examples/demos/Game2048/Game2048.js | 74 +++--- examples/demos/Game2048/Game2048Example.js | 2 +- examples/demos/Game2048/GameBoard.js | 70 ++--- examples/demos/TicTacToe/TicTacToe.js | 54 ++-- examples/demos/TicTacToe/TicTacToeExample.js | 2 +- 19 files changed, 482 insertions(+), 431 deletions(-) diff --git a/examples/apis/Clipboard/ClipboardExample.js b/examples/apis/Clipboard/ClipboardExample.js index 7459b2f6..f9d40941 100644 --- a/examples/apis/Clipboard/ClipboardExample.js +++ b/examples/apis/Clipboard/ClipboardExample.js @@ -1,6 +1,6 @@ import { Clipboard, Text, TextInput, View } from 'react-native'; import React, { Component } from 'react'; -import { action, storiesOf } from '@kadira/storybook'; +import { storiesOf } from '@kadira/storybook'; class ClipboardExample extends Component { render() { diff --git a/examples/apis/Linking/LinkingExample.js b/examples/apis/Linking/LinkingExample.js index 7b467c0f..0c10b6c9 100644 --- a/examples/apis/Linking/LinkingExample.js +++ b/examples/apis/Linking/LinkingExample.js @@ -1,6 +1,6 @@ import { Linking, StyleSheet, Text, View } from 'react-native'; import React, { Component } from 'react'; -import { storiesOf, action } from '@kadira/storybook'; +import { storiesOf } from '@kadira/storybook'; const url = 'https://mathiasbynens.github.io/rel-noopener/malicious.html'; diff --git a/examples/apis/PanResponder/PanResponderExample.js b/examples/apis/PanResponder/PanResponderExample.js index 647ba188..ece313ee 100644 --- a/examples/apis/PanResponder/PanResponderExample.js +++ b/examples/apis/PanResponder/PanResponderExample.js @@ -1,15 +1,13 @@ -'use strict'; +/* eslint-disable react/jsx-no-bind */ import createReactClass from 'create-react-class'; -import { storiesOf, action } from '@kadira/storybook'; +import React from 'react'; +import { storiesOf } from '@kadira/storybook'; +import { PanResponder, StyleSheet, View } from 'react-native'; -var React = require('react'); -var ReactNative = require('react-native'); -var { PanResponder, StyleSheet, View } = ReactNative; +const CIRCLE_SIZE = 80; -var CIRCLE_SIZE = 80; - -var PanResponderExample = createReactClass({ +const PanResponderExample = createReactClass({ _panResponder: {}, _previousLeft: 0, _previousTop: 0, @@ -93,7 +91,7 @@ var PanResponderExample = createReactClass({ } }); -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ circle: { width: CIRCLE_SIZE, height: CIRCLE_SIZE, diff --git a/examples/components/ActivityIndicator/ActivityIndicatorExample.js b/examples/components/ActivityIndicator/ActivityIndicatorExample.js index 11072d10..a763fa70 100644 --- a/examples/components/ActivityIndicator/ActivityIndicatorExample.js +++ b/examples/components/ActivityIndicator/ActivityIndicatorExample.js @@ -1,9 +1,3 @@ -import createReactClass from 'create-react-class'; -import React from 'react'; -import { storiesOf, action } from '@kadira/storybook'; -import { ActivityIndicator, StyleSheet, View } from 'react-native'; -import TimerMixin from 'react-timer-mixin'; - /** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. @@ -27,6 +21,12 @@ import TimerMixin from 'react-timer-mixin'; * @flow */ +import createReactClass from 'create-react-class'; +import React from 'react'; +import { storiesOf } from '@kadira/storybook'; +import { ActivityIndicator, StyleSheet, View } from 'react-native'; +import TimerMixin from 'react-timer-mixin'; + const ToggleAnimatingActivityIndicator = createReactClass({ mixins: [TimerMixin], @@ -51,9 +51,9 @@ const ToggleAnimatingActivityIndicator = createReactClass({ return ( ); } @@ -83,7 +83,7 @@ const examples = [ title: 'Large', render() { return ( - + ); } }, @@ -92,10 +92,10 @@ const examples = [ render() { return ( - - - - + + + + ); } @@ -117,7 +117,7 @@ const examples = [ return ( - + ); } diff --git a/examples/components/Button/ButtonExample.js b/examples/components/Button/ButtonExample.js index 19b5e6c0..2170c789 100644 --- a/examples/components/Button/ButtonExample.js +++ b/examples/components/Button/ButtonExample.js @@ -1,6 +1,6 @@ import React from 'react'; import { action, storiesOf } from '@kadira/storybook'; -import { Button, StyleSheet, View } from 'react-native'; +import { Button, View } from 'react-native'; const onButtonPress = action('Button has been pressed!'); @@ -13,9 +13,9 @@ const examples = [ render: function() { return (