From 338fb8b695421bbe1264dc1265b7060e2c2a0957 Mon Sep 17 00:00:00 2001 From: Chris Beer <chris@cbeer.info> Date: Wed, 16 Mar 2022 15:31:42 -0700 Subject: [PATCH] Allow some more PropTypes.object through eslint (#3542) --- .eslintrc | 9 ++++++++- src/components/AnnotationsOverlay.js | 4 ++-- src/components/AudioViewer.js | 4 ++-- src/components/OpenSeadragonViewer.js | 2 +- src/components/PrimaryWindow.js | 4 ++-- src/components/SearchPanelNavigation.js | 2 +- src/components/SearchResults.js | 4 ++-- src/components/VideoViewer.js | 4 ++-- src/components/WindowSideBarCanvasPanel.js | 2 +- src/components/WorkspaceAdd.js | 5 ++++- 10 files changed, 25 insertions(+), 15 deletions(-) diff --git a/.eslintrc b/.eslintrc index 35d920424..2dc55b0ec 100644 --- a/.eslintrc +++ b/.eslintrc @@ -30,6 +30,13 @@ }], "react/jsx-props-no-spreading": "off", "arrow-parens": "off", - "import/no-anonymous-default-export": "off" + "import/no-anonymous-default-export": "off", + "max-len": ["error", { + "code": 120, + "ignoreComments": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true, + "ignoreRegExpLiterals": true + }] } } diff --git a/src/components/AnnotationsOverlay.js b/src/components/AnnotationsOverlay.js index dad600e20..eb527f1d9 100644 --- a/src/components/AnnotationsOverlay.js +++ b/src/components/AnnotationsOverlay.js @@ -423,7 +423,7 @@ AnnotationsOverlay.defaultProps = { }; AnnotationsOverlay.propTypes = { - annotations: PropTypes.arrayOf(PropTypes.object), + annotations: PropTypes.arrayOf(PropTypes.object), // eslint-disable-line react/forbid-prop-types canvasWorld: PropTypes.instanceOf(CanvasWorld).isRequired, deselectAnnotation: PropTypes.func, drawAnnotations: PropTypes.bool, @@ -432,7 +432,7 @@ AnnotationsOverlay.propTypes = { hoverAnnotation: PropTypes.func, hoveredAnnotationIds: PropTypes.arrayOf(PropTypes.string), palette: PropTypes.object, // eslint-disable-line react/forbid-prop-types - searchAnnotations: PropTypes.arrayOf(PropTypes.object), + searchAnnotations: PropTypes.arrayOf(PropTypes.object), // eslint-disable-line react/forbid-prop-types selectAnnotation: PropTypes.func, selectedAnnotationId: PropTypes.string, viewer: PropTypes.object, // eslint-disable-line react/forbid-prop-types diff --git a/src/components/AudioViewer.js b/src/components/AudioViewer.js index fd63c4053..15d51c3d1 100644 --- a/src/components/AudioViewer.js +++ b/src/components/AudioViewer.js @@ -32,8 +32,8 @@ export class AudioViewer extends Component { AudioViewer.propTypes = { audioOptions: PropTypes.object, // eslint-disable-line react/forbid-prop-types - audioResources: PropTypes.arrayOf(PropTypes.object), - captions: PropTypes.arrayOf(PropTypes.object), + audioResources: PropTypes.arrayOf(PropTypes.object), // eslint-disable-line react/forbid-prop-types + captions: PropTypes.arrayOf(PropTypes.object), // eslint-disable-line react/forbid-prop-types classes: PropTypes.objectOf(PropTypes.string).isRequired, }; diff --git a/src/components/OpenSeadragonViewer.js b/src/components/OpenSeadragonViewer.js index 7c3244bf0..d6353a624 100644 --- a/src/components/OpenSeadragonViewer.js +++ b/src/components/OpenSeadragonViewer.js @@ -383,7 +383,7 @@ OpenSeadragonViewer.propTypes = { children: PropTypes.node, classes: PropTypes.objectOf(PropTypes.string).isRequired, drawAnnotations: PropTypes.bool, - infoResponses: PropTypes.arrayOf(PropTypes.object), + infoResponses: PropTypes.arrayOf(PropTypes.object), // eslint-disable-line react/forbid-prop-types label: PropTypes.string, nonTiledImages: PropTypes.array, // eslint-disable-line react/forbid-prop-types osdConfig: PropTypes.object, // eslint-disable-line react/forbid-prop-types diff --git a/src/components/PrimaryWindow.js b/src/components/PrimaryWindow.js index ee5d4e672..552681b8a 100644 --- a/src/components/PrimaryWindow.js +++ b/src/components/PrimaryWindow.js @@ -92,13 +92,13 @@ export class PrimaryWindow extends Component { } PrimaryWindow.propTypes = { - audioResources: PropTypes.arrayOf(PropTypes.object), + audioResources: PropTypes.arrayOf(PropTypes.object), // eslint-disable-line react/forbid-prop-types children: PropTypes.node, classes: PropTypes.objectOf(PropTypes.string).isRequired, isCollection: PropTypes.bool, isCollectionDialogVisible: PropTypes.bool, isFetching: PropTypes.bool, - videoResources: PropTypes.arrayOf(PropTypes.object), + videoResources: PropTypes.arrayOf(PropTypes.object), // eslint-disable-line react/forbid-prop-types view: PropTypes.string, windowId: PropTypes.string.isRequired, }; diff --git a/src/components/SearchPanelNavigation.js b/src/components/SearchPanelNavigation.js index 59f9eb65b..355a0787b 100644 --- a/src/components/SearchPanelNavigation.js +++ b/src/components/SearchPanelNavigation.js @@ -84,7 +84,7 @@ SearchPanelNavigation.propTypes = { classes: PropTypes.objectOf(PropTypes.string), direction: PropTypes.string.isRequired, numTotal: PropTypes.number, - searchHits: PropTypes.arrayOf(PropTypes.object), + searchHits: PropTypes.arrayOf(PropTypes.object), // eslint-disable-line react/forbid-prop-types searchService: PropTypes.shape({ id: PropTypes.string, }).isRequired, diff --git a/src/components/SearchResults.js b/src/components/SearchResults.js index 7c5ca415b..bb75972a8 100644 --- a/src/components/SearchResults.js +++ b/src/components/SearchResults.js @@ -149,8 +149,8 @@ SearchResults.propTypes = { isFetching: PropTypes.bool, nextSearch: PropTypes.string, query: PropTypes.string, - searchAnnotations: PropTypes.arrayOf(PropTypes.object), - searchHits: PropTypes.arrayOf(PropTypes.object), + searchAnnotations: PropTypes.arrayOf(PropTypes.object), // eslint-disable-line react/forbid-prop-types + searchHits: PropTypes.arrayOf(PropTypes.object), // eslint-disable-line react/forbid-prop-types searchNumTotal: PropTypes.number, t: PropTypes.func, windowId: PropTypes.string.isRequired, // eslint-disable-line react/no-unused-prop-types diff --git a/src/components/VideoViewer.js b/src/components/VideoViewer.js index ebcc6ff94..bb1d03270 100644 --- a/src/components/VideoViewer.js +++ b/src/components/VideoViewer.js @@ -30,10 +30,10 @@ export class VideoViewer extends Component { } VideoViewer.propTypes = { - captions: PropTypes.arrayOf(PropTypes.object), + captions: PropTypes.arrayOf(PropTypes.object), // eslint-disable-line react/forbid-prop-types classes: PropTypes.objectOf(PropTypes.string).isRequired, videoOptions: PropTypes.object, // eslint-disable-line react/forbid-prop-types - videoResources: PropTypes.arrayOf(PropTypes.object), + videoResources: PropTypes.arrayOf(PropTypes.object), // eslint-disable-line react/forbid-prop-types }; VideoViewer.defaultProps = { diff --git a/src/components/WindowSideBarCanvasPanel.js b/src/components/WindowSideBarCanvasPanel.js index abd76e08f..9d4e988f7 100644 --- a/src/components/WindowSideBarCanvasPanel.js +++ b/src/components/WindowSideBarCanvasPanel.js @@ -162,7 +162,7 @@ WindowSideBarCanvasPanel.propTypes = { collection: PropTypes.object, // eslint-disable-line react/forbid-prop-types id: PropTypes.string.isRequired, sequenceId: PropTypes.string, - sequences: PropTypes.arrayOf(PropTypes.object), + sequences: PropTypes.arrayOf(PropTypes.object), // eslint-disable-line react/forbid-prop-types showMultipart: PropTypes.func.isRequired, showToc: PropTypes.bool, t: PropTypes.func.isRequired, diff --git a/src/components/WorkspaceAdd.js b/src/components/WorkspaceAdd.js index 696038d3b..f1676e47a 100644 --- a/src/components/WorkspaceAdd.js +++ b/src/components/WorkspaceAdd.js @@ -179,7 +179,10 @@ export class WorkspaceAdd extends React.Component { WorkspaceAdd.propTypes = { addResource: PropTypes.func, - catalog: PropTypes.arrayOf(PropTypes.object), + catalog: PropTypes.arrayOf(PropTypes.shape({ + manifestId: PropTypes.string.isRequired, + provider: PropTypes.string, + })), classes: PropTypes.objectOf(PropTypes.string), setWorkspaceAddVisibility: PropTypes.func.isRequired, t: PropTypes.func, -- GitLab