From 7ea4ae563714ac7f120349bc67ebedbea683c01f Mon Sep 17 00:00:00 2001 From: Andrew Nicolaou Date: Sun, 8 Sep 2019 16:43:16 +0200 Subject: [PATCH] Fix linting errors and warnings --- .../components/createRedirectWithUsername.jsx | 5 ++--- client/modules/App/App.jsx | 5 ++++- client/modules/User/actions.js | 1 - .../User/components/DashboardTabSwitcher.jsx | 18 ++++++++---------- client/modules/User/pages/AccountView.jsx | 3 --- client/modules/User/pages/DashboardView.jsx | 4 ++-- 6 files changed, 16 insertions(+), 20 deletions(-) diff --git a/client/components/createRedirectWithUsername.jsx b/client/components/createRedirectWithUsername.jsx index a2bdd790..fe76b5cd 100644 --- a/client/components/createRedirectWithUsername.jsx +++ b/client/components/createRedirectWithUsername.jsx @@ -1,5 +1,4 @@ import React from 'react'; -import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { browserHistory } from 'react-router'; @@ -8,7 +7,7 @@ const RedirectToUser = ({ username, url = '/:username/sketches' }) => { if (username == null) { return; } - + browserHistory.replace(url.replace(':username', username)); }, [username]); @@ -23,6 +22,6 @@ function mapStateToProps(state) { const ConnectedRedirectToUser = connect(mapStateToProps)(RedirectToUser); -const createRedirectWithUsername = (url) => (props) => ; +const createRedirectWithUsername = url => props => ; export default createRedirectWithUsername; diff --git a/client/modules/App/App.jsx b/client/modules/App/App.jsx index 9a8e6bdb..045074eb 100644 --- a/client/modules/App/App.jsx +++ b/client/modules/App/App.jsx @@ -39,7 +39,10 @@ class App extends React.Component { App.propTypes = { children: PropTypes.element, location: PropTypes.shape({ - pathname: PropTypes.string + pathname: PropTypes.string, + state: PropTypes.shape({ + skipSavingPath: PropTypes.bool, + }), }).isRequired, setPreviousPath: PropTypes.func.isRequired, }; diff --git a/client/modules/User/actions.js b/client/modules/User/actions.js index 3c2f6d5b..93a874fb 100644 --- a/client/modules/User/actions.js +++ b/client/modules/User/actions.js @@ -1,6 +1,5 @@ import { browserHistory } from 'react-router'; import axios from 'axios'; -import crypto from 'crypto'; import * as ActionTypes from '../../constants'; import { showErrorModal, justOpenedProject } from '../IDE/actions/ide'; import { showToast, setToastText } from '../IDE/actions/toast'; diff --git a/client/modules/User/components/DashboardTabSwitcher.jsx b/client/modules/User/components/DashboardTabSwitcher.jsx index 3d333064..8143759f 100644 --- a/client/modules/User/components/DashboardTabSwitcher.jsx +++ b/client/modules/User/components/DashboardTabSwitcher.jsx @@ -27,16 +27,14 @@ Tab.propTypes = { to: PropTypes.string.isRequired, }; -const DashboardTabSwitcher = ({ currentTab, isOwner, username }) => { - return ( -
    -
    - Sketches - {isOwner && Assets} -
    -
- ); -}; +const DashboardTabSwitcher = ({ currentTab, isOwner, username }) => ( +
    +
    + Sketches + {isOwner && Assets} +
    +
+); DashboardTabSwitcher.propTypes = { currentTab: PropTypes.string.isRequired, diff --git a/client/modules/User/pages/AccountView.jsx b/client/modules/User/pages/AccountView.jsx index 7382656e..5648cee2 100644 --- a/client/modules/User/pages/AccountView.jsx +++ b/client/modules/User/pages/AccountView.jsx @@ -4,7 +4,6 @@ import { reduxForm } from 'redux-form'; import { bindActionCreators } from 'redux'; import { browserHistory } from 'react-router'; import { Tab, Tabs, TabList, TabPanel } from 'react-tabs'; -import InlineSVG from 'react-inlinesvg'; import axios from 'axios'; import { Helmet } from 'react-helmet'; import { updateSettings, initiateVerification, createApiKey, removeApiKey } from '../actions'; @@ -14,8 +13,6 @@ import GithubButton from '../components/GithubButton'; import APIKeyForm from '../components/APIKeyForm'; import NavBasic from '../../../components/NavBasic'; -const exitUrl = require('../../../images/exit.svg'); - class AccountView extends React.Component { constructor(props) { super(props); diff --git a/client/modules/User/pages/DashboardView.jsx b/client/modules/User/pages/DashboardView.jsx index a3172eee..ba1b63f0 100644 --- a/client/modules/User/pages/DashboardView.jsx +++ b/client/modules/User/pages/DashboardView.jsx @@ -2,7 +2,7 @@ import PropTypes from 'prop-types'; import React from 'react'; import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; -import { browserHistory, Link } from 'react-router'; +import { browserHistory } from 'react-router'; import { Helmet } from 'react-helmet'; import { updateSettings, initiateVerification, createApiKey, removeApiKey } from '../actions'; import NavBasic from '../../../components/NavBasic'; @@ -80,7 +80,7 @@ class DashboardView extends React.Component { - +
{ currentTab === TabKey.sketches ? :