From 50e22d0d1e405f2df4855520d6dd67b66c7856e1 Mon Sep 17 00:00:00 2001 From: Kimmo Puputti Date: Mon, 30 Jan 2017 10:57:27 +0200 Subject: [PATCH] Format JS with Prettier 0.13.1 --- src/Routes.js | 24 +++---- src/app.js | 20 +++--- .../BookingInfo/BookingInfo.test.js | 14 ++-- src/components/Discussion/Discussion.js | 4 +- .../FilterPanel/FilterPanel.test.js | 12 ++-- .../HeroSection/HeroSection.test.js | 12 ++-- src/components/ListingCard/ListingCard.js | 4 +- .../ListingCard/ListingCard.test.js | 12 ++-- .../ListingCardSmall/ListingCardSmall.js | 2 +- .../ListingCardSmall/ListingCardSmall.test.js | 12 ++-- src/components/MapPanel/MapPanel.test.js | 12 ++-- src/components/Menu/Menu.js | 2 +- src/components/NamedLink/NamedLink.test.js | 14 ++-- .../OrderDetailsPanel/OrderDetailsPanel.js | 2 +- .../OrderDetailsPanel.test.js | 12 ++-- .../OrderDiscussionPanel.test.js | 12 ++-- .../RoutesProvider/RoutesProvider.test.js | 2 +- .../SearchResultsPanel.test.js | 12 ++-- .../AuthenticationPage/AuthenticationPage.js | 8 +-- .../AuthenticationPage.test.js | 8 +-- .../ChangeAccountPasswordForm.js | 2 +- .../ChangeAccountPasswordForm.test.js | 8 +-- .../ChangePasswordForm/ChangePasswordForm.js | 2 +- .../ChangePasswordForm.test.js | 8 +-- .../CheckoutPage/CheckoutPage.test.js | 12 ++-- .../ContactDetailsPage/ContactDetailsPage.js | 2 +- .../ContactDetailsPage.test.js | 8 +-- .../EditProfilePage/EditProfilePage.test.js | 8 +-- .../HeroSearchForm/HeroSearchForm.js | 2 +- .../HeroSearchForm/HeroSearchForm.test.js | 8 +-- src/containers/InboxPage/InboxPage.js | 2 +- src/containers/InboxPage/InboxPage.test.js | 8 +-- src/containers/LandingPage/LandingPage.js | 8 +-- .../LandingPage/LandingPage.test.js | 12 ++-- src/containers/ListingPage/ListingPage.js | 64 ++++++++++--------- .../ListingPage/ListingPage.test.js | 12 ++-- src/containers/LoginForm/LoginForm.js | 2 +- src/containers/LoginForm/LoginForm.test.js | 8 +-- .../ManageListingsPage/ManageListingsPage.js | 2 +- .../ManageListingsPage.test.js | 8 +-- src/containers/NotFoundPage/NotFoundPage.js | 2 +- .../NotFoundPage/NotFoundPage.test.js | 8 +-- src/containers/OrderPage/OrderPage.js | 4 +- src/containers/OrderPage/OrderPage.test.js | 12 ++-- .../PasswordChangePage.test.js | 8 +-- .../PasswordForgottenForm.js | 2 +- .../PasswordForgottenForm.test.js | 8 +-- .../PasswordForgottenPage.test.js | 8 +-- .../PayoutPreferencesPage.js | 2 +- .../PayoutPreferencesPage.test.js | 8 +-- .../ProfilePage/ProfilePage.test.js | 8 +-- .../SalesConversationPage.js | 2 +- .../SalesConversationPage.test.js | 8 +-- src/containers/SearchPage/SearchPage.ducks.js | 2 +- src/containers/SearchPage/SearchPage.js | 2 +- src/containers/SearchPage/SearchPage.test.js | 26 ++++---- src/containers/SecurityPage/SecurityPage.js | 2 +- .../SecurityPage/SecurityPage.test.js | 8 +-- src/containers/SignUpForm/SignUpForm.js | 2 +- src/containers/SignUpForm/SignUpForm.test.js | 8 +-- .../StyleguidePage/StyleguidePage.js | 10 ++- src/ducks/FlashNotification.ducks.js | 8 +-- src/ducks/FlashNotification.test.js | 10 +-- src/routesConfiguration.js | 2 +- src/store.js | 3 +- 65 files changed, 239 insertions(+), 310 deletions(-) diff --git a/src/Routes.js b/src/Routes.js index 4bdf8712..bbf28319 100644 --- a/src/Routes.js +++ b/src/Routes.js @@ -36,19 +36,15 @@ const MatchWithSubRoutes = props => { { - return canShowComponent - ? - : ( - - ); - }} + return canShowComponent + ? + : ; + }} /> ); }; @@ -62,7 +58,7 @@ MatchWithSubRoutes.propTypes = { auth: bool, exactly: bool, name: string.isRequired, - component: oneOfType([ func, node ]).isRequired, + component: oneOfType([func, node]).isRequired, }; const Routes = props => { diff --git a/src/app.js b/src/app.js index 601910d9..d1fb5236 100644 --- a/src/app.js +++ b/src/app.js @@ -12,15 +12,15 @@ import localeData from './translations/en.json'; export const ClientApp = props => { const { store } = props; - addLocaleData([ ...en ]); + addLocaleData([...en]); return ( {({ router }) => ( - - - - )} + + + + )} ); @@ -32,15 +32,15 @@ ClientApp.propTypes = { store: any.isRequired }; export const ServerApp = props => { const { url, context, store } = props; - addLocaleData([ ...en ]); + addLocaleData([...en]); return ( {({ router }) => ( - - - - )} + + + + )} ); diff --git a/src/components/BookingInfo/BookingInfo.test.js b/src/components/BookingInfo/BookingInfo.test.js index 45b060e1..8d4dd881 100644 --- a/src/components/BookingInfo/BookingInfo.test.js +++ b/src/components/BookingInfo/BookingInfo.test.js @@ -5,14 +5,12 @@ import BookingInfo from './BookingInfo'; describe('BookingInfo', () => { it('matches snapshot', () => { const component = renderer.create( - ( - - ), + , ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/components/Discussion/Discussion.js b/src/components/Discussion/Discussion.js index 4e1da1b5..4ebb66c3 100644 --- a/src/components/Discussion/Discussion.js +++ b/src/components/Discussion/Discussion.js @@ -50,8 +50,8 @@ class Discussion extends Component { autoFocus type="text" ref={input => { - this.input = input; - }} + this.input = input; + }} value={this.state.message} onChange={this.handleOnChange} /> diff --git a/src/components/FilterPanel/FilterPanel.test.js b/src/components/FilterPanel/FilterPanel.test.js index 86338357..fd416a8e 100644 --- a/src/components/FilterPanel/FilterPanel.test.js +++ b/src/components/FilterPanel/FilterPanel.test.js @@ -8,13 +8,11 @@ import FilterPanel from './FilterPanel'; describe('FilterPanel', () => { it('matches snapshot', () => { const component = renderer.create( - ( - - - - - - ), + + + + + , ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/components/HeroSection/HeroSection.test.js b/src/components/HeroSection/HeroSection.test.js index e1ab55f1..3717fb28 100644 --- a/src/components/HeroSection/HeroSection.test.js +++ b/src/components/HeroSection/HeroSection.test.js @@ -6,13 +6,11 @@ import HeroSection from './HeroSection'; describe('HeroSection', () => { it('matches snapshot', () => { const component = renderer.create( - ( - - - test - - - ), + + + test + + , ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/components/ListingCard/ListingCard.js b/src/components/ListingCard/ListingCard.js index a868367d..2d270c20 100644 --- a/src/components/ListingCard/ListingCard.js +++ b/src/components/ListingCard/ListingCard.js @@ -29,7 +29,7 @@ const ListingCard = props => { {location}
- ({review.rating}/5){' '} + ({review.rating}/5){' '} {review.count}
@@ -41,7 +41,7 @@ const ListingCard = props => {
{author.name}
- review: {author.review.rating}/5 + review: {author.review.rating}/5
diff --git a/src/components/ListingCard/ListingCard.test.js b/src/components/ListingCard/ListingCard.test.js index c016fffe..10a2d624 100644 --- a/src/components/ListingCard/ListingCard.test.js +++ b/src/components/ListingCard/ListingCard.test.js @@ -21,13 +21,11 @@ describe('ListingCard', () => { }, }; const component = renderer.create( - ( - - - - - - ), + + + + + , ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/components/ListingCardSmall/ListingCardSmall.js b/src/components/ListingCardSmall/ListingCardSmall.js index c4578dd0..62d6f00a 100644 --- a/src/components/ListingCardSmall/ListingCardSmall.js +++ b/src/components/ListingCardSmall/ListingCardSmall.js @@ -18,7 +18,7 @@ const ListingCardSmall = props => { {title}
- ({review.rating}/5){' '} + ({review.rating}/5){' '} {review.count}
diff --git a/src/components/ListingCardSmall/ListingCardSmall.test.js b/src/components/ListingCardSmall/ListingCardSmall.test.js index 2f5e2eb1..aaedf380 100644 --- a/src/components/ListingCardSmall/ListingCardSmall.test.js +++ b/src/components/ListingCardSmall/ListingCardSmall.test.js @@ -21,13 +21,11 @@ describe('ListingCardSmall', () => { }, }; const component = renderer.create( - ( - - - - - - ), + + + + + , ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/components/MapPanel/MapPanel.test.js b/src/components/MapPanel/MapPanel.test.js index 562860b6..ada34d9c 100644 --- a/src/components/MapPanel/MapPanel.test.js +++ b/src/components/MapPanel/MapPanel.test.js @@ -8,13 +8,11 @@ import MapPanel from './MapPanel'; describe('MapPanel', () => { it('matches snapshot', () => { const component = renderer.create( - ( - - - - - - ), + + + + + , ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/components/Menu/Menu.js b/src/components/Menu/Menu.js index 96c3a38d..ac498324 100644 --- a/src/components/Menu/Menu.js +++ b/src/components/Menu/Menu.js @@ -3,7 +3,7 @@ import css from './Menu.css'; const Menu = () => (
- New York, Jan 2nd – Jan 4th + New York, Jan 2nd – Jan 4th
); diff --git a/src/components/NamedLink/NamedLink.test.js b/src/components/NamedLink/NamedLink.test.js index d51fdc34..67a46ad4 100644 --- a/src/components/NamedLink/NamedLink.test.js +++ b/src/components/NamedLink/NamedLink.test.js @@ -12,17 +12,15 @@ describe('NamedLink', () => { { pattern: '/somepage/:id', name: 'SomePage', component: () =>
blaa
}, ]; const component = renderer.create( - ( - - - to SomePage - - - ), + + + to SomePage + + , ); const json = component.toJSON(); expect(json.type).toEqual('a'); expect(json.props.href).toEqual(`/somepage/${id}`); - expect(json.children).toEqual([ 'to SomePage' ]); + expect(json.children).toEqual(['to SomePage']); }); }); diff --git a/src/components/OrderDetailsPanel/OrderDetailsPanel.js b/src/components/OrderDetailsPanel/OrderDetailsPanel.js index 15c1f150..8c1fcdde 100644 --- a/src/components/OrderDetailsPanel/OrderDetailsPanel.js +++ b/src/components/OrderDetailsPanel/OrderDetailsPanel.js @@ -44,7 +44,7 @@ OrderDetailsPanel.defaultProps = { className: null }; OrderDetailsPanel.propTypes = { className: string, - orderId: oneOfType([ string, number ]).isRequired, + orderId: oneOfType([string, number]).isRequired, title: string.isRequired, imageUrl: string.isRequired, info: object.isRequired, diff --git a/src/components/OrderDetailsPanel/OrderDetailsPanel.test.js b/src/components/OrderDetailsPanel/OrderDetailsPanel.test.js index a8fb3d30..557f7ea9 100644 --- a/src/components/OrderDetailsPanel/OrderDetailsPanel.test.js +++ b/src/components/OrderDetailsPanel/OrderDetailsPanel.test.js @@ -25,13 +25,11 @@ describe('OrderDetailsPanel', () => { confirmationCode: 'some-test-confirmation-code', }; const component = renderer.create( - ( - - - - - - ), + + + + + , ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/components/OrderDiscussionPanel/OrderDiscussionPanel.test.js b/src/components/OrderDiscussionPanel/OrderDiscussionPanel.test.js index 707fc89c..a26cab3b 100644 --- a/src/components/OrderDiscussionPanel/OrderDiscussionPanel.test.js +++ b/src/components/OrderDiscussionPanel/OrderDiscussionPanel.test.js @@ -8,13 +8,11 @@ import routesConfiguration from '../../routesConfiguration'; describe('OrderDiscussionPanel', () => { it('matches snapshot', () => { const component = renderer.create( - ( - - - - - - ), + + + + + , ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/components/RoutesProvider/RoutesProvider.test.js b/src/components/RoutesProvider/RoutesProvider.test.js index 889b78c6..a274af4f 100644 --- a/src/components/RoutesProvider/RoutesProvider.test.js +++ b/src/components/RoutesProvider/RoutesProvider.test.js @@ -4,7 +4,7 @@ import renderer from 'react-test-renderer'; describe('RoutesProvider', () => { it('should contain routes from context', () => { - const routesConf = [ { name: 'SomePage' } ]; + const routesConf = [{ name: 'SomePage' }]; const Child = (props, context) => { return
{context.routes[0].name}
; }; diff --git a/src/components/SearchResultsPanel/SearchResultsPanel.test.js b/src/components/SearchResultsPanel/SearchResultsPanel.test.js index 0cb99f5e..d45404d0 100644 --- a/src/components/SearchResultsPanel/SearchResultsPanel.test.js +++ b/src/components/SearchResultsPanel/SearchResultsPanel.test.js @@ -8,13 +8,11 @@ import SearchResultsPanel from './SearchResultsPanel'; describe('SearchResultsPanel', () => { it('matches snapshot', () => { const component = renderer.create( - ( - - - - - - ), + + + + + , ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/containers/AuthenticationPage/AuthenticationPage.js b/src/containers/AuthenticationPage/AuthenticationPage.js index 6ab4e8f8..081c0a37 100644 --- a/src/containers/AuthenticationPage/AuthenticationPage.js +++ b/src/containers/AuthenticationPage/AuthenticationPage.js @@ -45,12 +45,12 @@ class AuthenticationPage extends Component { ? : ; - const fromLoginMsg = from && from.pathname ? ( -

+ const fromLoginMsg = from && from.pathname + ?

You must log in to view the page at {from.pathname}

- ) : null; + : null; return ( @@ -69,7 +69,7 @@ const { any, oneOf, shape } = PropTypes; AuthenticationPage.propTypes = { location: shape({ state: shape({ from: any }) }), - tab: oneOf([ 'login', 'signup' ]), + tab: oneOf(['login', 'signup']), }; export default AuthenticationPage; diff --git a/src/containers/AuthenticationPage/AuthenticationPage.test.js b/src/containers/AuthenticationPage/AuthenticationPage.test.js index 142ee30a..9d7b1503 100644 --- a/src/containers/AuthenticationPage/AuthenticationPage.test.js +++ b/src/containers/AuthenticationPage/AuthenticationPage.test.js @@ -6,11 +6,9 @@ import AuthenticationPage from './AuthenticationPage'; describe('AuthenticationPage', () => { it('matches snapshot', () => { const component = renderer.create( - ( - - - - ), + + + , ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/containers/ChangeAccountPasswordForm/ChangeAccountPasswordForm.js b/src/containers/ChangeAccountPasswordForm/ChangeAccountPasswordForm.js index c99af0f2..32eb919f 100644 --- a/src/containers/ChangeAccountPasswordForm/ChangeAccountPasswordForm.js +++ b/src/containers/ChangeAccountPasswordForm/ChangeAccountPasswordForm.js @@ -19,4 +19,4 @@ const ChangeAccountPasswordForm = props => { ChangeAccountPasswordForm.propTypes = { ...formPropTypes }; -export default reduxForm({ form: 'changeAccountPassword' })(ChangeAccountPasswordForm) +export default reduxForm({ form: 'changeAccountPassword' })(ChangeAccountPasswordForm); diff --git a/src/containers/ChangeAccountPasswordForm/ChangeAccountPasswordForm.test.js b/src/containers/ChangeAccountPasswordForm/ChangeAccountPasswordForm.test.js index b24da87d..dc73fa5f 100644 --- a/src/containers/ChangeAccountPasswordForm/ChangeAccountPasswordForm.test.js +++ b/src/containers/ChangeAccountPasswordForm/ChangeAccountPasswordForm.test.js @@ -6,11 +6,9 @@ import ChangeAccountPasswordForm from './ChangeAccountPasswordForm'; describe('ChangeAccountPasswordForm', () => { it('matches snapshot', () => { const component = renderer.create( - ( - - - - ), + + + , ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/containers/ChangePasswordForm/ChangePasswordForm.js b/src/containers/ChangePasswordForm/ChangePasswordForm.js index 8a49cfcc..1270cf58 100644 --- a/src/containers/ChangePasswordForm/ChangePasswordForm.js +++ b/src/containers/ChangePasswordForm/ChangePasswordForm.js @@ -16,4 +16,4 @@ const ChangePasswordForm = props => { ChangePasswordForm.propTypes = { ...formPropTypes }; -export default reduxForm({ form: 'changePassword' })(ChangePasswordForm) +export default reduxForm({ form: 'changePassword' })(ChangePasswordForm); diff --git a/src/containers/ChangePasswordForm/ChangePasswordForm.test.js b/src/containers/ChangePasswordForm/ChangePasswordForm.test.js index 91cefbb4..29fa32ce 100644 --- a/src/containers/ChangePasswordForm/ChangePasswordForm.test.js +++ b/src/containers/ChangePasswordForm/ChangePasswordForm.test.js @@ -6,11 +6,9 @@ import ChangePasswordForm from './ChangePasswordForm'; describe('ChangePasswordForm', () => { it('matches snapshot', () => { const component = renderer.create( - ( - - - - ), + + + , ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/containers/CheckoutPage/CheckoutPage.test.js b/src/containers/CheckoutPage/CheckoutPage.test.js index 230583e2..a530fe97 100644 --- a/src/containers/CheckoutPage/CheckoutPage.test.js +++ b/src/containers/CheckoutPage/CheckoutPage.test.js @@ -8,13 +8,11 @@ import routesConfiguration from '../../routesConfiguration'; describe('CheckoutPage', () => { it('matches snapshot', () => { const component = renderer.create( - ( - - - - - - ), + + + + + , ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/containers/ContactDetailsPage/ContactDetailsPage.js b/src/containers/ContactDetailsPage/ContactDetailsPage.js index 7ab15bea..c96ad26b 100644 --- a/src/containers/ContactDetailsPage/ContactDetailsPage.js +++ b/src/containers/ContactDetailsPage/ContactDetailsPage.js @@ -1,4 +1,4 @@ import React from 'react'; import { PageLayout } from '../../components'; -export default () => +export default () => ; diff --git a/src/containers/ContactDetailsPage/ContactDetailsPage.test.js b/src/containers/ContactDetailsPage/ContactDetailsPage.test.js index 1a92bb20..c051c09f 100644 --- a/src/containers/ContactDetailsPage/ContactDetailsPage.test.js +++ b/src/containers/ContactDetailsPage/ContactDetailsPage.test.js @@ -6,11 +6,9 @@ import ContactDetailsPage from './ContactDetailsPage'; describe('ContactDetailsPage', () => { it('matches snapshot', () => { const component = renderer.create( - ( - - - - ), + + + , ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/containers/EditProfilePage/EditProfilePage.test.js b/src/containers/EditProfilePage/EditProfilePage.test.js index e010f4ae..4ac3125b 100644 --- a/src/containers/EditProfilePage/EditProfilePage.test.js +++ b/src/containers/EditProfilePage/EditProfilePage.test.js @@ -6,11 +6,9 @@ import EditProfilePage from './EditProfilePage'; describe('EditProfilePage', () => { it('matches snapshot', () => { const component = renderer.create( - ( - - - - ), + + + , ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/containers/HeroSearchForm/HeroSearchForm.js b/src/containers/HeroSearchForm/HeroSearchForm.js index 19972a95..4e960656 100644 --- a/src/containers/HeroSearchForm/HeroSearchForm.js +++ b/src/containers/HeroSearchForm/HeroSearchForm.js @@ -29,4 +29,4 @@ const HeroSearchForm = props => { HeroSearchForm.propTypes = { ...formPropTypes, intl: intlShape.isRequired }; -export default reduxForm({ form: 'herosearchform' })(injectIntl(HeroSearchForm)) +export default reduxForm({ form: 'herosearchform' })(injectIntl(HeroSearchForm)); diff --git a/src/containers/HeroSearchForm/HeroSearchForm.test.js b/src/containers/HeroSearchForm/HeroSearchForm.test.js index 0c4f607d..23b8362f 100644 --- a/src/containers/HeroSearchForm/HeroSearchForm.test.js +++ b/src/containers/HeroSearchForm/HeroSearchForm.test.js @@ -10,11 +10,9 @@ describe('HeroSearchForm', () => { it('matches snapshot', () => { const store = configureStore(); const component = renderer.create( - ( - - - - ), + + + , ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/containers/InboxPage/InboxPage.js b/src/containers/InboxPage/InboxPage.js index 01035ee9..bab272aa 100644 --- a/src/containers/InboxPage/InboxPage.js +++ b/src/containers/InboxPage/InboxPage.js @@ -28,6 +28,6 @@ InboxPage.defaultProps = { filter: 'conversation' }; const { oneOf } = PropTypes; -InboxPage.propTypes = { filter: oneOf([ 'orders', 'sales', 'inbox' ]) }; +InboxPage.propTypes = { filter: oneOf(['orders', 'sales', 'inbox']) }; export default InboxPage; diff --git a/src/containers/InboxPage/InboxPage.test.js b/src/containers/InboxPage/InboxPage.test.js index a79fd5ab..e9ac2ecb 100644 --- a/src/containers/InboxPage/InboxPage.test.js +++ b/src/containers/InboxPage/InboxPage.test.js @@ -6,11 +6,9 @@ import InboxPage from './InboxPage'; describe('InboxPage', () => { it('matches snapshot', () => { const component = renderer.create( - ( - - - - ), + + + , ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/containers/LandingPage/LandingPage.js b/src/containers/LandingPage/LandingPage.js index 8a13ec55..d5898c2e 100644 --- a/src/containers/LandingPage/LandingPage.js +++ b/src/containers/LandingPage/LandingPage.js @@ -13,13 +13,11 @@ export const LandingPageComponent = props => { const handleSubmit = createSubmitHandler(props.onLocationChanged); const componentOrRedirect = props.LocationFilter && props.LocationFilter.length > 0 ? - : ( - + : - - ); + ; return componentOrRedirect; }; @@ -43,4 +41,4 @@ const mapDispatchToProps = function mapDispatchToProps(dispatch) { return { onLocationChanged: v => dispatch(changeLocationFilter(v)) }; }; -export default connect(mapStateToProps, mapDispatchToProps)(LandingPageComponent) +export default connect(mapStateToProps, mapDispatchToProps)(LandingPageComponent); diff --git a/src/containers/LandingPage/LandingPage.test.js b/src/containers/LandingPage/LandingPage.test.js index 4614d5b8..d9ab2cea 100644 --- a/src/containers/LandingPage/LandingPage.test.js +++ b/src/containers/LandingPage/LandingPage.test.js @@ -8,13 +8,11 @@ import routesConfiguration from '../../routesConfiguration'; describe('LandingPage', () => { it('matches snapshot', () => { const component = renderer.create( - ( - - - v} /> - - - ), + + + v} /> + + , ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/containers/ListingPage/ListingPage.js b/src/containers/ListingPage/ListingPage.js index 65b2a772..e5961c87 100644 --- a/src/containers/ListingPage/ListingPage.js +++ b/src/containers/ListingPage/ListingPage.js @@ -13,7 +13,8 @@ const info = { { id: 4, title: 'img4', imageUrl: 'http://placehold.it/750x470' }, { id: 5, title: 'img5', imageUrl: 'http://placehold.it/750x470' }, ], - description: ` + description: ( + `

Organic Music Production in a Sustainable, Ethical and Professional Studio.

@@ -24,17 +25,20 @@ const info = { Banyan Studios is a comfortable, conscious, inspiring and creative retreat for musicians trying to convey their message through state of the art Audio & Video.

https://vimeo.com/168106603 - `, + ` + ), reviews: [ { id: 1, reviewer: { avatar: 'http://placehold.it/44x44', name: 'Vesa L.', date: 'January 2017' }, rating: 4, - review: ` + review: ( + ` Great studio in the New York for music professionals. Everything you need can be found from here and John was helpful with the right settings - we even got some tips for our songs! :) - `, + ` + ), }, ], }; @@ -46,12 +50,12 @@ const ListingPage = () => ( {info.images[0].title}
{info.images.slice(1).map(image => ( -
-
- {image.title} -
+
+
+ {image.title}
- ))} +
+ ))}
{/* eslint-disable react/no-danger */} @@ -71,34 +75,34 @@ const ListingPage = () => (

Studio reviews (1)

{info.reviews.map(review => ( -
-

{review.review}

+
+

{review.review}

+
+
+ {review.reviewer.name} +
-
- {review.reviewer.name} -
-
- {review.reviewer.name} - {review.reviewer.date} - -
-
- review: {review.rating}/5 -
+ {review.reviewer.name} + {review.reviewer.date} + +
+
+ review: {review.rating}/5
- ))} +
+ ))}
Map
- {`Book ${info.title}`} + {`Book ${info.title}`}
); diff --git a/src/containers/ListingPage/ListingPage.test.js b/src/containers/ListingPage/ListingPage.test.js index 03db6a9b..0b296af8 100644 --- a/src/containers/ListingPage/ListingPage.test.js +++ b/src/containers/ListingPage/ListingPage.test.js @@ -8,13 +8,11 @@ import ListingPage from './ListingPage'; describe('ListingPage', () => { it('matches snapshot', () => { const component = renderer.create( - ( - - - - - - ), + + + + + , ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/containers/LoginForm/LoginForm.js b/src/containers/LoginForm/LoginForm.js index dca94677..a4db9cbc 100644 --- a/src/containers/LoginForm/LoginForm.js +++ b/src/containers/LoginForm/LoginForm.js @@ -17,4 +17,4 @@ const LoginForm = props => { LoginForm.propTypes = { ...formPropTypes }; -export default reduxForm({ form: 'login' })(LoginForm) +export default reduxForm({ form: 'login' })(LoginForm); diff --git a/src/containers/LoginForm/LoginForm.test.js b/src/containers/LoginForm/LoginForm.test.js index 80bd0132..0c618e95 100644 --- a/src/containers/LoginForm/LoginForm.test.js +++ b/src/containers/LoginForm/LoginForm.test.js @@ -6,11 +6,9 @@ import LoginForm from './LoginForm'; describe('LoginForm', () => { it('matches snapshot', () => { const component = renderer.create( - ( - - - - ), + + + , ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/containers/ManageListingsPage/ManageListingsPage.js b/src/containers/ManageListingsPage/ManageListingsPage.js index 6a76103e..f9919b58 100644 --- a/src/containers/ManageListingsPage/ManageListingsPage.js +++ b/src/containers/ManageListingsPage/ManageListingsPage.js @@ -8,4 +8,4 @@ export default () => (
  • Listing 1234
  • -) +); diff --git a/src/containers/ManageListingsPage/ManageListingsPage.test.js b/src/containers/ManageListingsPage/ManageListingsPage.test.js index 6bfdd4ed..1f991cc6 100644 --- a/src/containers/ManageListingsPage/ManageListingsPage.test.js +++ b/src/containers/ManageListingsPage/ManageListingsPage.test.js @@ -6,11 +6,9 @@ import ManageListingsPage from './ManageListingsPage'; describe('ManageListingsPage', () => { it('matches snapshot', () => { const component = renderer.create( - ( - - - - ), + + + , ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/containers/NotFoundPage/NotFoundPage.js b/src/containers/NotFoundPage/NotFoundPage.js index 50aa9350..2aa3dc62 100644 --- a/src/containers/NotFoundPage/NotFoundPage.js +++ b/src/containers/NotFoundPage/NotFoundPage.js @@ -6,4 +6,4 @@ export default () => ( Index page -) +); diff --git a/src/containers/NotFoundPage/NotFoundPage.test.js b/src/containers/NotFoundPage/NotFoundPage.test.js index 04bfe224..fb5fcc1d 100644 --- a/src/containers/NotFoundPage/NotFoundPage.test.js +++ b/src/containers/NotFoundPage/NotFoundPage.test.js @@ -6,11 +6,9 @@ import NotFoundPage from './NotFoundPage'; describe('NotFoundPage', () => { it('matches snapshot', () => { const component = renderer.create( - ( - - - - ), + + + , ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/containers/OrderPage/OrderPage.js b/src/containers/OrderPage/OrderPage.js index be357a5e..ba15e599 100644 --- a/src/containers/OrderPage/OrderPage.js +++ b/src/containers/OrderPage/OrderPage.js @@ -58,8 +58,8 @@ const OrderPage = props => { const { string, shape, oneOfType, number, oneOf } = PropTypes; OrderPage.propTypes = { - params: shape({ id: oneOfType([ number, string ]).isRequired }).isRequired, - tab: oneOf([ 'details', 'discussion' ]).isRequired, + params: shape({ id: oneOfType([number, string]).isRequired }).isRequired, + tab: oneOf(['details', 'discussion']).isRequired, }; export default OrderPage; diff --git a/src/containers/OrderPage/OrderPage.test.js b/src/containers/OrderPage/OrderPage.test.js index 45ab61ce..cd1988ab 100644 --- a/src/containers/OrderPage/OrderPage.test.js +++ b/src/containers/OrderPage/OrderPage.test.js @@ -8,13 +8,11 @@ import routesConfiguration from '../../routesConfiguration'; describe('OrderPage', () => { it('matches snapshot', () => { const component = renderer.create( - ( - - - - - - ), + + + + + , ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/containers/PasswordChangePage/PasswordChangePage.test.js b/src/containers/PasswordChangePage/PasswordChangePage.test.js index 01352103..e2e0670d 100644 --- a/src/containers/PasswordChangePage/PasswordChangePage.test.js +++ b/src/containers/PasswordChangePage/PasswordChangePage.test.js @@ -6,11 +6,9 @@ import PasswordChangePage from './PasswordChangePage'; describe('PasswordChangePage', () => { it('matches snapshot', () => { const component = renderer.create( - ( - - - - ), + + + , ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/containers/PasswordForgottenForm/PasswordForgottenForm.js b/src/containers/PasswordForgottenForm/PasswordForgottenForm.js index fd85b4ce..9ad0cea8 100644 --- a/src/containers/PasswordForgottenForm/PasswordForgottenForm.js +++ b/src/containers/PasswordForgottenForm/PasswordForgottenForm.js @@ -15,4 +15,4 @@ const PasswordForgottenForm = props => { PasswordForgottenForm.propTypes = { ...formPropTypes }; -export default reduxForm({ form: 'passwordForgotten' })(PasswordForgottenForm) +export default reduxForm({ form: 'passwordForgotten' })(PasswordForgottenForm); diff --git a/src/containers/PasswordForgottenForm/PasswordForgottenForm.test.js b/src/containers/PasswordForgottenForm/PasswordForgottenForm.test.js index cbcd3b40..3708f339 100644 --- a/src/containers/PasswordForgottenForm/PasswordForgottenForm.test.js +++ b/src/containers/PasswordForgottenForm/PasswordForgottenForm.test.js @@ -8,11 +8,9 @@ describe('PasswordForgottenForm', () => { it('matches snapshot', () => { const store = configureStore(); const component = renderer.create( - ( - - - - ), + + + , ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/containers/PasswordForgottenPage/PasswordForgottenPage.test.js b/src/containers/PasswordForgottenPage/PasswordForgottenPage.test.js index 2a3fa7dd..b250fcda 100644 --- a/src/containers/PasswordForgottenPage/PasswordForgottenPage.test.js +++ b/src/containers/PasswordForgottenPage/PasswordForgottenPage.test.js @@ -6,11 +6,9 @@ import PasswordForgottenPage from './PasswordForgottenPage'; describe('PasswordForgottenPage', () => { it('matches snapshot', () => { const component = renderer.create( - ( - - - - ), + + + , ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/containers/PayoutPreferencesPage/PayoutPreferencesPage.js b/src/containers/PayoutPreferencesPage/PayoutPreferencesPage.js index 735d8c25..f2b361c2 100644 --- a/src/containers/PayoutPreferencesPage/PayoutPreferencesPage.js +++ b/src/containers/PayoutPreferencesPage/PayoutPreferencesPage.js @@ -1,4 +1,4 @@ import React from 'react'; import { PageLayout } from '../../components'; -export default () => +export default () => ; diff --git a/src/containers/PayoutPreferencesPage/PayoutPreferencesPage.test.js b/src/containers/PayoutPreferencesPage/PayoutPreferencesPage.test.js index 0611bb25..0fbf5530 100644 --- a/src/containers/PayoutPreferencesPage/PayoutPreferencesPage.test.js +++ b/src/containers/PayoutPreferencesPage/PayoutPreferencesPage.test.js @@ -6,11 +6,9 @@ import PayoutPreferencesPage from './PayoutPreferencesPage'; describe('PayoutPreferencesPage', () => { it('matches snapshot', () => { const component = renderer.create( - ( - - - - ), + + + , ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/containers/ProfilePage/ProfilePage.test.js b/src/containers/ProfilePage/ProfilePage.test.js index 0d48a67c..d182ef7e 100644 --- a/src/containers/ProfilePage/ProfilePage.test.js +++ b/src/containers/ProfilePage/ProfilePage.test.js @@ -6,11 +6,9 @@ import ProfilePage from './ProfilePage'; describe('ProfilePage', () => { it('matches snapshot', () => { const component = renderer.create( - ( - - - - ), + + + , ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/containers/SalesConversationPage/SalesConversationPage.js b/src/containers/SalesConversationPage/SalesConversationPage.js index 6a80e93e..f1885721 100644 --- a/src/containers/SalesConversationPage/SalesConversationPage.js +++ b/src/containers/SalesConversationPage/SalesConversationPage.js @@ -13,7 +13,7 @@ const SalesConversationPage = props => { Details tab

    Mobile layout needs different views for discussion and details.

    - Discussion view is the default if route doesn't specify mobile tab (e.g. + Discussion view is the default if route doesn't specify mobile tab (e.g. /order/1234 )

    diff --git a/src/containers/SalesConversationPage/SalesConversationPage.test.js b/src/containers/SalesConversationPage/SalesConversationPage.test.js index 9644d7ef..a0fe67ed 100644 --- a/src/containers/SalesConversationPage/SalesConversationPage.test.js +++ b/src/containers/SalesConversationPage/SalesConversationPage.test.js @@ -6,11 +6,9 @@ import SalesConversationPage from './SalesConversationPage'; describe('SalesConversationPage', () => { it('matches snapshot', () => { const component = renderer.create( - ( - - - - ), + + + , ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/containers/SearchPage/SearchPage.ducks.js b/src/containers/SearchPage/SearchPage.ducks.js index 7dc216eb..f977d4a7 100644 --- a/src/containers/SearchPage/SearchPage.ducks.js +++ b/src/containers/SearchPage/SearchPage.ducks.js @@ -14,7 +14,7 @@ export default function reducer(state = {}, action = {}) { switch (type) { case ADD_FILTER: { const stateFilters = state.filters || []; - return { ...state, ...{ filters: unionWith(stateFilters, [ payload ], isEqual) } }; + return { ...state, ...{ filters: unionWith(stateFilters, [payload], isEqual) } }; } default: return state; diff --git a/src/containers/SearchPage/SearchPage.js b/src/containers/SearchPage/SearchPage.js index 6a476b9f..5bb52070 100644 --- a/src/containers/SearchPage/SearchPage.js +++ b/src/containers/SearchPage/SearchPage.js @@ -109,4 +109,4 @@ const mapDispatchToProps = function mapDispatchToProps(dispatch) { }; }; -export default connect(mapStateToProps, mapDispatchToProps)(SearchPageComponent) +export default connect(mapStateToProps, mapDispatchToProps)(SearchPageComponent); diff --git a/src/containers/SearchPage/SearchPage.test.js b/src/containers/SearchPage/SearchPage.test.js index d14edb8b..5fbb94ea 100644 --- a/src/containers/SearchPage/SearchPage.test.js +++ b/src/containers/SearchPage/SearchPage.test.js @@ -9,13 +9,11 @@ import routesConfiguration from '../../routesConfiguration'; describe('SearchPageComponent', () => { it('matches snapshot', () => { const component = renderer.create( - ( - - - - - - ), + + + + + , ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); @@ -40,18 +38,18 @@ describe('SearchPageDucs', () => { const addFilter1 = addFilter('location', 'helsinki'); const addFilter2 = addFilter('gears', 3); const reduced = reducer([], addFilter1); - const reducedWithInitialContent = reducer({ filters: [ addFilter1.payload ] }, addFilter2); - expect(reduced).toEqual({ filters: [ addFilter1.payload ] }); - expect( - reducedWithInitialContent, - ).toEqual({ filters: [ addFilter1.payload, addFilter2.payload ] }); + const reducedWithInitialContent = reducer({ filters: [addFilter1.payload] }, addFilter2); + expect(reduced).toEqual({ filters: [addFilter1.payload] }); + expect(reducedWithInitialContent).toEqual({ + filters: [addFilter1.payload, addFilter2.payload], + }); }); it('should handle duplicates ADD_FILTER', () => { const filter = { location: 'helsinki' }; const addFilter = { type: ADD_FILTER, payload: filter }; - const reducedWithInitialContent = reducer({ filters: [ filter ] }, addFilter); - expect(reducedWithInitialContent).toEqual({ filters: [ filter ] }); + const reducedWithInitialContent = reducer({ filters: [filter] }, addFilter); + expect(reducedWithInitialContent).toEqual({ filters: [filter] }); }); }); }); diff --git a/src/containers/SecurityPage/SecurityPage.js b/src/containers/SecurityPage/SecurityPage.js index d4fe7060..fbae5d97 100644 --- a/src/containers/SecurityPage/SecurityPage.js +++ b/src/containers/SecurityPage/SecurityPage.js @@ -11,4 +11,4 @@ export default () => ( -) +); diff --git a/src/containers/SecurityPage/SecurityPage.test.js b/src/containers/SecurityPage/SecurityPage.test.js index 47795cd4..cf9217a3 100644 --- a/src/containers/SecurityPage/SecurityPage.test.js +++ b/src/containers/SecurityPage/SecurityPage.test.js @@ -6,11 +6,9 @@ import SecurityPage from './SecurityPage'; describe('SecurityPage', () => { it('matches snapshot', () => { const component = renderer.create( - ( - - - - ), + + + , ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/containers/SignUpForm/SignUpForm.js b/src/containers/SignUpForm/SignUpForm.js index de4e0643..46aabc8b 100644 --- a/src/containers/SignUpForm/SignUpForm.js +++ b/src/containers/SignUpForm/SignUpForm.js @@ -21,4 +21,4 @@ const SignUpForm = props => { SignUpForm.propTypes = { ...formPropTypes }; -export default reduxForm({ form: 'signup' })(SignUpForm) +export default reduxForm({ form: 'signup' })(SignUpForm); diff --git a/src/containers/SignUpForm/SignUpForm.test.js b/src/containers/SignUpForm/SignUpForm.test.js index 7f535d7a..01903cc0 100644 --- a/src/containers/SignUpForm/SignUpForm.test.js +++ b/src/containers/SignUpForm/SignUpForm.test.js @@ -6,11 +6,9 @@ import SignUpForm from './SignUpForm'; describe('SignUpForm', () => { it('matches snapshot', () => { const component = renderer.create( - ( - - - - ), + + + , ); const tree = component.toJSON(); expect(tree).toMatchSnapshot(); diff --git a/src/containers/StyleguidePage/StyleguidePage.js b/src/containers/StyleguidePage/StyleguidePage.js index 2005efd5..b51b777a 100644 --- a/src/containers/StyleguidePage/StyleguidePage.js +++ b/src/containers/StyleguidePage/StyleguidePage.js @@ -38,7 +38,7 @@ Example.defaultProps = { description: null, props: {} }; Example.propTypes = { componentName: string.isRequired, exampleName: string.isRequired, - component: oneOfType([ func, node ]).isRequired, + component: oneOfType([func, node]).isRequired, description: string, props: object, }; @@ -48,11 +48,9 @@ const Examples = props => { const toExamples = (exmpls, name) => (
    • - { - map(exmpls, (exmpl, exampleName) => ( - - )) - } + {map(exmpls, (exmpl, exampleName) => ( + + ))}
  • ); diff --git a/src/ducks/FlashNotification.ducks.js b/src/ducks/FlashNotification.ducks.js index 27eb27fe..b2c74332 100644 --- a/src/ducks/FlashNotification.ducks.js +++ b/src/ducks/FlashNotification.ducks.js @@ -26,15 +26,13 @@ export default (state = initialState, action) => { return state; case REMOVE_FLASH_NOTIFICATION: - return state.map( - findIndex(state, msg => msg.id === payload.id), - msg => msg.set('isRead', true), - ); + return state.map(findIndex(state, msg => msg.id === payload.id), msg => + msg.set('isRead', true)); default: return state; } -} +}; // Action Creators let nextMessageId = 1; diff --git a/src/ducks/FlashNotification.test.js b/src/ducks/FlashNotification.test.js index 3a2064c8..7a7ff344 100644 --- a/src/ducks/FlashNotification.test.js +++ b/src/ducks/FlashNotification.test.js @@ -35,15 +35,15 @@ describe('FlashNotification', () => { const addFlashNote1 = addFlashNotification('error', 'Run the tests'); const addFlashNote2 = addFlashNotification('error', 'Run the tests again'); const reduced = reducer([], addFlashNote1); - const reducedWithInitialContent = reducer([ addFlashNote1.payload ], addFlashNote2); - expect(reduced).toEqual([ addFlashNote1.payload ]); - expect(reducedWithInitialContent).toEqual([ addFlashNote1.payload, addFlashNote2.payload ]); + const reducedWithInitialContent = reducer([addFlashNote1.payload], addFlashNote2); + expect(reduced).toEqual([addFlashNote1.payload]); + expect(reducedWithInitialContent).toEqual([addFlashNote1.payload, addFlashNote2.payload]); }); it('should handle duplicates ADD_FILTER', () => { const addFlashNote = addFlashNotification('error', 'Run the tests'); - const reducedWithInitialContent = reducer([ addFlashNote.payload ], addFlashNote); - expect(reducedWithInitialContent).toEqual([ addFlashNote.payload ]); + const reducedWithInitialContent = reducer([addFlashNote.payload], addFlashNote); + expect(reducedWithInitialContent).toEqual([addFlashNote.payload]); }); }); }); diff --git a/src/routesConfiguration.js b/src/routesConfiguration.js index d318b648..a57a7144 100644 --- a/src/routesConfiguration.js +++ b/src/routesConfiguration.js @@ -244,7 +244,7 @@ const routesConfiguration = [ ]; const flattenRoutes = routesArray => - routesArray.reduce((a, b) => a.concat(b.routes ? [ b ].concat(flattenRoutes(b.routes)) : b), []); + routesArray.reduce((a, b) => a.concat(b.routes ? [b].concat(flattenRoutes(b.routes)) : b), []); const findRouteByName = (nameToFind, routes) => { const flattenedRoutes = flattenRoutes(routes); diff --git a/src/store.js b/src/store.js index 4b1c3fea..04929ca7 100644 --- a/src/store.js +++ b/src/store.js @@ -7,7 +7,8 @@ import createReducer from './reducers'; * (like redux-saga or redux-thunk middleware) */ export default function configureStore(initialState) { - const useReduxDevTools = process.env.NODE_ENV !== 'production' && typeof window !== 'undefined' && + const useReduxDevTools = process.env.NODE_ENV !== 'production' && + typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION__; if (useReduxDevTools) {