Skip to content

Commit

Permalink
Lint JS
Browse files Browse the repository at this point in the history
  • Loading branch information
tnajdek committed Jul 1, 2021
1 parent 1501206 commit 73033e3
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/js/components/about.jsx
@@ -1,3 +1,4 @@
/* eslint-disable no-irregular-whitespace */
import React, { memo } from 'react';
import PropTypes from 'prop-types';
import Button from './ui/button';
Expand Down
3 changes: 2 additions & 1 deletion src/js/components/confirm-add-dialog.jsx
Expand Up @@ -10,7 +10,7 @@ import { formatBib, formatFallback } from '../cite';
class ConfirmAddDialog extends React.Component {
render() {
const { activeDialog, onConfirmAddCancel, onConfirmAddConfirm, itemToConfirm,
styleHasBibliography } = this.props;
styleHasBibliography } = this.props;

if(!itemToConfirm || activeDialog !== 'CONFIRM_ADD_DIALOG') {
return null;
Expand Down Expand Up @@ -77,6 +77,7 @@ class ConfirmAddDialog extends React.Component {
itemToConfirm: PropTypes.object,
onConfirmAddCancel: PropTypes.func.isRequired,
onConfirmAddConfirm: PropTypes.func.isRequired,
styleHasBibliography: PropTypes.bool,
}
}

Expand Down
7 changes: 6 additions & 1 deletion src/js/components/container.jsx
Expand Up @@ -3,6 +3,7 @@ import ZoteroBib from 'zotero-translation-client';
import { useParams, useLocation, useHistory } from "react-router-dom";
import copy from 'copy-to-clipboard';
import SmoothScroll from 'smooth-scroll';
import PropTypes from 'prop-types';

import { calcOffset, dedupMultipleChoiceItems, ensureNoBlankItems, fetchFromPermalink,
fetchWithCachedFallback, getOneTimeBibliographyOrFallback, getExpandedCitationStyles, getItemsCSL,
Expand Down Expand Up @@ -1101,7 +1102,7 @@ const BibWebContainer = props => {
{ isConfirmed: true }
);
}
}, []);
}, []); //eslint-disable-line react-hooks/exhaustive-deps


return (<ZBib
Expand Down Expand Up @@ -1174,4 +1175,8 @@ const BibWebContainer = props => {
/>);
}

BibWebContainer.propTypes = {
config: PropTypes.object
}

export default memo(BibWebContainer);
5 changes: 3 additions & 2 deletions src/js/components/form/creator-field.jsx
Expand Up @@ -55,7 +55,7 @@ const CreatorTypeSelector = memo(forwardRef((props, ref) => {
value={ value }
{ ... pick(rest, p => p.startsWith('data-')) }
>
{ creatorsCount > 1 && (
{ creatorsCount > 1 ? (
<React.Fragment>
<SelectDivider />
{ (index > 1) && (
Expand All @@ -74,7 +74,7 @@ const CreatorTypeSelector = memo(forwardRef((props, ref) => {
option={ { label: 'Move Down', value: '_down' } }
/> ) }
</React.Fragment>
) }
) : null }
</SelectInput>
);
}));
Expand Down Expand Up @@ -399,6 +399,7 @@ CreatorField.propTypes = {
isReadOnly: PropTypes.bool,
isSingle: PropTypes.bool,
isVirtual: PropTypes.bool,
onAddMany: PropTypes.func,
onChange: PropTypes.func,
onCreatorAdd: PropTypes.func,
onCreatorRemove: PropTypes.func,
Expand Down
9 changes: 5 additions & 4 deletions src/js/components/ui/editable.jsx
Expand Up @@ -60,10 +60,8 @@ class EditableContent extends React.PureComponent {
inputComponent: PropTypes.elementType,
options: PropTypes.array,
placeholder: PropTypes.string,
value: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number
])
title: PropTypes.string,
value: PropTypes.oneOfType([PropTypes.string,PropTypes.number]),
};
}

Expand Down Expand Up @@ -139,6 +137,7 @@ class Editable extends React.PureComponent {

static propTypes = {
children: PropTypes.oneOfType([PropTypes.element, PropTypes.array]),
className: PropTypes.string,
input: PropTypes.element,
inputComponent: PropTypes.elementType,
isActive: PropTypes.bool,
Expand All @@ -147,6 +146,8 @@ class Editable extends React.PureComponent {
isReadOnly: PropTypes.bool,
isSelect: PropTypes.bool,
isTextArea: PropTypes.bool,
onClick: PropTypes.func,
onFocus: PropTypes.func,
tabIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
};
}
Expand Down
1 change: 1 addition & 0 deletions src/js/components/ui/select.jsx
Expand Up @@ -304,6 +304,7 @@ const Select = forwardRef((props, ref) => {
Select.displayName = 'Select';

Select.propTypes = {
children: PropTypes.oneOfType([PropTypes.element, PropTypes.array]),
className: PropTypes.string,
disabled: PropTypes.bool,
id: PropTypes.string,
Expand Down
3 changes: 3 additions & 0 deletions src/js/components/zbib.jsx
Expand Up @@ -196,12 +196,15 @@ class ZBib extends React.PureComponent {
isReadOnly: PropTypes.bool,
isSaveToZoteroVisible: PropTypes.bool,
isTouchUser: PropTypes.bool,
isTranslating: PropTypes.bool,
itemUnderReview: PropTypes.object,
itemUnderReviewBibliography: PropTypes.object,
lastDeletedItem: PropTypes.object,
messages: PropTypes.array.isRequired,
onCitationCopy: PropTypes.func.isRequired,
onCitationModifierChange: PropTypes.func.isRequired,
onDismiss: PropTypes.func.isRequired,
onGetStartedClick: PropTypes.func,
onHelpClick: PropTypes.func.isRequired,
onReadMore: PropTypes.func.isRequired,
onSaveToZoteroHide: PropTypes.func.isRequired,
Expand Down
2 changes: 2 additions & 0 deletions src/js/enhancers/user-type-detector.jsx
Expand Up @@ -55,6 +55,8 @@ var UserTypeDetector = ComposedComponent => class extends React.PureComponent {
render() {
return <ComposedComponent {...this.props } { ...this.state } />;
}

static displayName = "UserTypeDetector";
};

export default UserTypeDetector;

0 comments on commit 73033e3

Please sign in to comment.