Skip to content
This repository has been archived by the owner on Jan 19, 2023. It is now read-only.

Commit

Permalink
fix: fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
wuweiweiwu committed Dec 10, 2018
1 parent 311f933 commit c2acf2c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"jest": true
},
"rules": {
"react/jsx-filename-extension": 0
"react/jsx-filename-extension": 0,
"react/destructuring-assignment": 0
}
}
10 changes: 6 additions & 4 deletions examples/cats/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,15 @@ class App extends Component {
}

moveNext() {
this.setState({ index: (this.state.index + 1) % images.length });
this.setState(prevState => ({
index: (prevState.index + 1) % images.length,
}));
}

movePrev() {
this.setState({
index: (this.state.index + images.length - 1) % images.length,
});
this.setState(prevState => ({
index: (prevState.index + images.length - 1) % images.length,
}));
}

render() {
Expand Down
2 changes: 2 additions & 0 deletions examples/cats/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* globals document */
/* globals document */
import React from 'react';
import ReactDOM from 'react-dom';
import App from './app';
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/react-image-lightbox.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ describe('Lightbox structure', () => {

it('contains custom toolbar buttons when supplied', () => {
wrapper.setProps({
toolbarButtons: [<button className="my-test-button" />],
toolbarButtons: [<button type="button" className="my-test-button" />],
});
expect(wrapper.find('.ril-toolbar__item .my-test-button').length).toEqual(
1
Expand Down
4 changes: 3 additions & 1 deletion src/react-image-lightbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,9 @@ class ReactImageLightbox extends Component {
// Ignore requests that don't change the zoom level
if (nextZoomLevel === this.state.zoomLevel) {
return;
} else if (nextZoomLevel === MIN_ZOOM_LEVEL) {
}

if (nextZoomLevel === MIN_ZOOM_LEVEL) {
// Snap back to center if zoomed all the way out
this.setState({
zoomLevel: nextZoomLevel,
Expand Down

0 comments on commit c2acf2c

Please sign in to comment.