Skip to content

Commit 338fb8b

Browse files
authored
Allow some more PropTypes.object through eslint (#3542)
1 parent d8b1c60 commit 338fb8b

10 files changed

Lines changed: 25 additions & 15 deletions

.eslintrc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@
3030
}],
3131
"react/jsx-props-no-spreading": "off",
3232
"arrow-parens": "off",
33-
"import/no-anonymous-default-export": "off"
33+
"import/no-anonymous-default-export": "off",
34+
"max-len": ["error", {
35+
"code": 120,
36+
"ignoreComments": true,
37+
"ignoreStrings": true,
38+
"ignoreTemplateLiterals": true,
39+
"ignoreRegExpLiterals": true
40+
}]
3441
}
3542
}

src/components/AnnotationsOverlay.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ AnnotationsOverlay.defaultProps = {
423423
};
424424

425425
AnnotationsOverlay.propTypes = {
426-
annotations: PropTypes.arrayOf(PropTypes.object),
426+
annotations: PropTypes.arrayOf(PropTypes.object), // eslint-disable-line react/forbid-prop-types
427427
canvasWorld: PropTypes.instanceOf(CanvasWorld).isRequired,
428428
deselectAnnotation: PropTypes.func,
429429
drawAnnotations: PropTypes.bool,
@@ -432,7 +432,7 @@ AnnotationsOverlay.propTypes = {
432432
hoverAnnotation: PropTypes.func,
433433
hoveredAnnotationIds: PropTypes.arrayOf(PropTypes.string),
434434
palette: PropTypes.object, // eslint-disable-line react/forbid-prop-types
435-
searchAnnotations: PropTypes.arrayOf(PropTypes.object),
435+
searchAnnotations: PropTypes.arrayOf(PropTypes.object), // eslint-disable-line react/forbid-prop-types
436436
selectAnnotation: PropTypes.func,
437437
selectedAnnotationId: PropTypes.string,
438438
viewer: PropTypes.object, // eslint-disable-line react/forbid-prop-types

src/components/AudioViewer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ export class AudioViewer extends Component {
3232

3333
AudioViewer.propTypes = {
3434
audioOptions: PropTypes.object, // eslint-disable-line react/forbid-prop-types
35-
audioResources: PropTypes.arrayOf(PropTypes.object),
36-
captions: PropTypes.arrayOf(PropTypes.object),
35+
audioResources: PropTypes.arrayOf(PropTypes.object), // eslint-disable-line react/forbid-prop-types
36+
captions: PropTypes.arrayOf(PropTypes.object), // eslint-disable-line react/forbid-prop-types
3737
classes: PropTypes.objectOf(PropTypes.string).isRequired,
3838
};
3939

src/components/OpenSeadragonViewer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ OpenSeadragonViewer.propTypes = {
383383
children: PropTypes.node,
384384
classes: PropTypes.objectOf(PropTypes.string).isRequired,
385385
drawAnnotations: PropTypes.bool,
386-
infoResponses: PropTypes.arrayOf(PropTypes.object),
386+
infoResponses: PropTypes.arrayOf(PropTypes.object), // eslint-disable-line react/forbid-prop-types
387387
label: PropTypes.string,
388388
nonTiledImages: PropTypes.array, // eslint-disable-line react/forbid-prop-types
389389
osdConfig: PropTypes.object, // eslint-disable-line react/forbid-prop-types

src/components/PrimaryWindow.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,13 @@ export class PrimaryWindow extends Component {
9292
}
9393

9494
PrimaryWindow.propTypes = {
95-
audioResources: PropTypes.arrayOf(PropTypes.object),
95+
audioResources: PropTypes.arrayOf(PropTypes.object), // eslint-disable-line react/forbid-prop-types
9696
children: PropTypes.node,
9797
classes: PropTypes.objectOf(PropTypes.string).isRequired,
9898
isCollection: PropTypes.bool,
9999
isCollectionDialogVisible: PropTypes.bool,
100100
isFetching: PropTypes.bool,
101-
videoResources: PropTypes.arrayOf(PropTypes.object),
101+
videoResources: PropTypes.arrayOf(PropTypes.object), // eslint-disable-line react/forbid-prop-types
102102
view: PropTypes.string,
103103
windowId: PropTypes.string.isRequired,
104104
};

src/components/SearchPanelNavigation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ SearchPanelNavigation.propTypes = {
8484
classes: PropTypes.objectOf(PropTypes.string),
8585
direction: PropTypes.string.isRequired,
8686
numTotal: PropTypes.number,
87-
searchHits: PropTypes.arrayOf(PropTypes.object),
87+
searchHits: PropTypes.arrayOf(PropTypes.object), // eslint-disable-line react/forbid-prop-types
8888
searchService: PropTypes.shape({
8989
id: PropTypes.string,
9090
}).isRequired,

src/components/SearchResults.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ SearchResults.propTypes = {
149149
isFetching: PropTypes.bool,
150150
nextSearch: PropTypes.string,
151151
query: PropTypes.string,
152-
searchAnnotations: PropTypes.arrayOf(PropTypes.object),
153-
searchHits: PropTypes.arrayOf(PropTypes.object),
152+
searchAnnotations: PropTypes.arrayOf(PropTypes.object), // eslint-disable-line react/forbid-prop-types
153+
searchHits: PropTypes.arrayOf(PropTypes.object), // eslint-disable-line react/forbid-prop-types
154154
searchNumTotal: PropTypes.number,
155155
t: PropTypes.func,
156156
windowId: PropTypes.string.isRequired, // eslint-disable-line react/no-unused-prop-types

src/components/VideoViewer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ export class VideoViewer extends Component {
3030
}
3131

3232
VideoViewer.propTypes = {
33-
captions: PropTypes.arrayOf(PropTypes.object),
33+
captions: PropTypes.arrayOf(PropTypes.object), // eslint-disable-line react/forbid-prop-types
3434
classes: PropTypes.objectOf(PropTypes.string).isRequired,
3535
videoOptions: PropTypes.object, // eslint-disable-line react/forbid-prop-types
36-
videoResources: PropTypes.arrayOf(PropTypes.object),
36+
videoResources: PropTypes.arrayOf(PropTypes.object), // eslint-disable-line react/forbid-prop-types
3737
};
3838

3939
VideoViewer.defaultProps = {

src/components/WindowSideBarCanvasPanel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ WindowSideBarCanvasPanel.propTypes = {
162162
collection: PropTypes.object, // eslint-disable-line react/forbid-prop-types
163163
id: PropTypes.string.isRequired,
164164
sequenceId: PropTypes.string,
165-
sequences: PropTypes.arrayOf(PropTypes.object),
165+
sequences: PropTypes.arrayOf(PropTypes.object), // eslint-disable-line react/forbid-prop-types
166166
showMultipart: PropTypes.func.isRequired,
167167
showToc: PropTypes.bool,
168168
t: PropTypes.func.isRequired,

src/components/WorkspaceAdd.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,10 @@ export class WorkspaceAdd extends React.Component {
179179

180180
WorkspaceAdd.propTypes = {
181181
addResource: PropTypes.func,
182-
catalog: PropTypes.arrayOf(PropTypes.object),
182+
catalog: PropTypes.arrayOf(PropTypes.shape({
183+
manifestId: PropTypes.string.isRequired,
184+
provider: PropTypes.string,
185+
})),
183186
classes: PropTypes.objectOf(PropTypes.string),
184187
setWorkspaceAddVisibility: PropTypes.func.isRequired,
185188
t: PropTypes.func,

0 commit comments

Comments
 (0)