From 41f57d90be930fb0af7dace6a12ad5e47edbd0f6 Mon Sep 17 00:00:00 2001 From: Noah Loomans Date: Fri, 2 Feb 2018 15:57:54 +0100 Subject: Simplify prop-types --- .eslintrc.js | 1 + src/client/react/components/container/Results.js | 11 ++--------- src/client/react/components/container/Search.js | 11 ++--------- src/client/react/components/container/View.js | 11 ++--------- src/client/react/components/container/WeekSelector.js | 9 ++------- src/client/react/components/page/User.js | 7 +------ 6 files changed, 10 insertions(+), 40 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index b253a04..389b34b 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -10,5 +10,6 @@ module.exports = { "no-underscore-dangle": ["error", { "allow": ["_test"] }], "class-methods-use-this": "off", "no-prototype-builtins": "off", + "react/forbid-prop-types": "off", } }; diff --git a/src/client/react/components/container/Results.js b/src/client/react/components/container/Results.js index 0f70aa6..3e8a7ec 100644 --- a/src/client/react/components/container/Results.js +++ b/src/client/react/components/container/Results.js @@ -52,15 +52,8 @@ Results.propTypes = { results: PropTypes.arrayOf(PropTypes.string).isRequired, isExactMatch: PropTypes.bool.isRequired, selectedResult: PropTypes.string, - match: PropTypes.shape({ - params: PropTypes.shape({ - type: PropTypes.string, - value: PropTypes.string, - }).isRequired, - }).isRequired, - history: PropTypes.shape({ - push: PropTypes.func.isRequired, - }).isRequired, + match: PropTypes.object.isRequired, + history: PropTypes.object.isRequired, dispatch: PropTypes.func.isRequired, }; diff --git a/src/client/react/components/container/Search.js b/src/client/react/components/container/Search.js index 4f3c6ee..cfddaac 100644 --- a/src/client/react/components/container/Search.js +++ b/src/client/react/components/container/Search.js @@ -125,15 +125,8 @@ Search.propTypes = { selectedResult: PropTypes.string, isExactMatch: PropTypes.bool.isRequired, searchText: PropTypes.string.isRequired, - match: PropTypes.shape({ - params: PropTypes.shape({ - type: PropTypes.string, - value: PropTypes.string, - }).isRequired, - }).isRequired, - history: PropTypes.shape({ - push: PropTypes.func.isRequired, - }).isRequired, + match: PropTypes.object.isRequired, + history: PropTypes.object.isRequired, dispatch: PropTypes.func.isRequired, }; diff --git a/src/client/react/components/container/View.js b/src/client/react/components/container/View.js index 052173f..090f5c0 100644 --- a/src/client/react/components/container/View.js +++ b/src/client/react/components/container/View.js @@ -38,15 +38,8 @@ View.propTypes = { state: PropTypes.string.isRequired, htmlStr: PropTypes.string, }))).isRequired, - match: PropTypes.shape({ - params: PropTypes.shape({ - type: PropTypes.string.isRequired, - value: PropTypes.string.isRequired, - }).isRequired, - }).isRequired, - location: PropTypes.shape({ - search: PropTypes.string.isRequired, - }).isRequired, + match: PropTypes.object.isRequired, + location: PropTypes.object.isRequired, dispatch: PropTypes.func.isRequired, }; diff --git a/src/client/react/components/container/WeekSelector.js b/src/client/react/components/container/WeekSelector.js index a7ffa3a..c6c1518 100644 --- a/src/client/react/components/container/WeekSelector.js +++ b/src/client/react/components/container/WeekSelector.js @@ -33,13 +33,8 @@ const WeekSelector = ({ location, history }) => { }; WeekSelector.propTypes = { - location: PropTypes.shape({ - pathname: PropTypes.string.isRequired, - search: PropTypes.string.isRequired, - }).isRequired, - history: PropTypes.shape({ - push: PropTypes.func.isRequired, - }).isRequired, + location: PropTypes.object.isRequired, + history: PropTypes.object.isRequired, }; export default withRouter(WeekSelector); diff --git a/src/client/react/components/page/User.js b/src/client/react/components/page/User.js index 1b7e1ce..202d998 100644 --- a/src/client/react/components/page/User.js +++ b/src/client/react/components/page/User.js @@ -32,12 +32,7 @@ const UserPage = ({ match }) => { }; UserPage.propTypes = { - match: PropTypes.shape({ - params: PropTypes.shape({ - type: PropTypes.string.isRequired, - value: PropTypes.string.isRequired, - }).isRequired, - }).isRequired, + match: PropTypes.object.isRequired, }; export default UserPage; -- cgit v1.1