Unverified Commit 276b8b51 authored by Marcos Iglesias's avatar Marcos Iglesias Committed by GitHub

Fixes issues with no-unused-expressions ESLint rule (#538)

parent 2c6c8590
...@@ -65,7 +65,7 @@ describe('HomePage', () => { ...@@ -65,7 +65,7 @@ describe('HomePage', () => {
it('calls searchReset', () => { it('calls searchReset', () => {
const searchResetSpy = jest.spyOn(props, 'searchReset'); const searchResetSpy = jest.spyOn(props, 'searchReset');
wrapper.instance().componentDidMount(); wrapper.instance().componentDidMount();
expect(searchResetSpy).toHaveBeenCalled; expect(searchResetSpy).toHaveBeenCalled();
}); });
}); });
}); });
......
...@@ -179,9 +179,12 @@ class TagInput extends React.Component<TagInputProps, TagInputState> { ...@@ -179,9 +179,12 @@ class TagInput extends React.Component<TagInputProps, TagInputState> {
toggleTag = (event, tagName) => { toggleTag = (event, tagName) => {
const element = event.currentTarget; const element = event.currentTarget;
element.classList.contains('selected')
? element.classList.remove('selected') if (element.classList.contains('selected')) {
: element.classList.add('selected'); element.classList.remove('selected');
} else {
element.classList.add('selected');
}
if (!this.batchEditSet.hasOwnProperty(tagName)) { if (!this.batchEditSet.hasOwnProperty(tagName)) {
this.batchEditSet[tagName] = BatchEditState.PUT; this.batchEditSet[tagName] = BatchEditState.PUT;
...@@ -240,11 +243,15 @@ class TagInput extends React.Component<TagInputProps, TagInputState> { ...@@ -240,11 +243,15 @@ class TagInput extends React.Component<TagInputProps, TagInputState> {
} }
startEditing = () => { startEditing = () => {
this.props.setEditMode && this.props.setEditMode(true); if (this.props.setEditMode) {
this.props.setEditMode(true);
}
}; };
stopEditing = () => { stopEditing = () => {
this.props.setEditMode && this.props.setEditMode(false); if (this.props.setEditMode) {
this.props.setEditMode(false);
}
}; };
render() { render() {
......
...@@ -280,7 +280,6 @@ ...@@ -280,7 +280,6 @@
"@typescript-eslint/dot-notation": "warn", "@typescript-eslint/dot-notation": "warn",
"@typescript-eslint/lines-between-class-members": "warn", "@typescript-eslint/lines-between-class-members": "warn",
"@typescript-eslint/naming-convention": "warn", "@typescript-eslint/naming-convention": "warn",
"@typescript-eslint/no-unused-expressions": "warn",
"@typescript-eslint/no-unused-vars": "warn", "@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/member-delimiter-style": [ "@typescript-eslint/member-delimiter-style": [
"off", "off",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment