From bbe0ed156ef332acf3707e51420a880f2cbfb0b6 Mon Sep 17 00:00:00 2001 From: Vadym Shymko Date: Fri, 24 Apr 2020 16:00:28 +0300 Subject: [PATCH] Update packages --- .eslintignore | 2 - package.json | 25 +- src/index.jsx | 103 ++++---- yarn.lock | 659 +++++++++++++++++++++++++++++++++++++------------- 4 files changed, 553 insertions(+), 236 deletions(-) delete mode 100644 .eslintignore diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 23bc6cd..0000000 --- a/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -dist/* -example/* diff --git a/package.json b/package.json index f0a364d..25504ee 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-simply-carousel", - "version": "2.1.8", + "version": "2.1.9", "description": "Simple react.js carousel component", "main": "dist/index.js", "files": [ @@ -11,8 +11,8 @@ "sideEffects": false, "scripts": { "build": "webpack", - "lint": "eslint . --ignore-path .eslintignore --ext .js,.jsx", - "lint:fix": "eslint . --ignore-path .eslintignore --ext .js,.jsx --fix", + "lint": "eslint . --ignore-path .gitignore --ext .js,.jsx", + "lint:fix": "eslint . --ignore-path .gitignore --ext .js,.jsx --fix", "prepublish": "yarn run lint && yarn run build" }, "husky": { @@ -72,22 +72,23 @@ "babel-plugin-transform-react-remove-prop-types": "^0.4.24", "babel-plugin-transform-remove-console": "^6.9.4", "clean-webpack-plugin": "^3.0.0", - "css-loader": "^3.5.2", - "eslint": "^5.16.0", - "eslint-config-airbnb": "^17.1.1", - "eslint-import-resolver-webpack": "^0.11.1", - "eslint-loader": "^2.1.1", - "eslint-plugin-import": "^2.18.0", + "css-loader": "^3.5.3", + "eslint": "^6.8.0", + "eslint-config-airbnb": "^18.1.0", + "eslint-import-resolver-webpack": "^0.12.1", + "eslint-loader": "^4.0.0", + "eslint-plugin-import": "^2.20.2", "eslint-plugin-jsx-a11y": "^6.2.3", - "eslint-plugin-prettier": "^3.1.0", - "eslint-plugin-react": "^7.14.2", + "eslint-plugin-prettier": "^3.1.3", + "eslint-plugin-react": "^7.19.0", "husky": "^4.2.5", "jest": "^25.4.0", "less": "^3.11.1", "less-loader": "^5.0.0", "lint-staged": "^10.1.7", + "path": "^0.12.7", "postcss-loader": "^3.0.0", - "style-loader": "^1.1.4", + "style-loader": "^1.2.0", "webpack": "^4.43.0", "webpack-bundle-analyzer": "^3.7.0", "webpack-cli": "^3.3.11" diff --git a/src/index.jsx b/src/index.jsx index 0424cbf..b58fb34 100644 --- a/src/index.jsx +++ b/src/index.jsx @@ -4,54 +4,6 @@ import PropTypes from 'prop-types'; import styles from './styles.less'; class ReactSimplyCarousel extends Component { - static propTypes = { - activeSlideIndex: PropTypes.number.isRequired, - activeSlideProps: PropTypes.objectOf(PropTypes.any), - autoplay: PropTypes.bool, - autoplayDirection: PropTypes.oneOf(['forward', 'backward']), - backwardBtnProps: PropTypes.objectOf(PropTypes.any), - centerMode: PropTypes.bool, - children: PropTypes.node, - containerProps: PropTypes.objectOf(PropTypes.any), - delay: PropTypes.number, - disableNavIfAllVisible: PropTypes.bool, - easing: PropTypes.string, - forwardBtnProps: PropTypes.objectOf(PropTypes.any), - hideNavIfAllVisible: PropTypes.bool, - innerProps: PropTypes.objectOf(PropTypes.any), - itemsListProps: PropTypes.objectOf(PropTypes.any), - itemsToScroll: PropTypes.number, - itemsToShow: PropTypes.number, - onAfterChange: PropTypes.func, - onRequestChange: PropTypes.func.isRequired, - responsiveProps: PropTypes.arrayOf(PropTypes.object), - speed: PropTypes.number, - updateOnItemClick: PropTypes.bool, - }; - - static defaultProps = { - activeSlideProps: {}, - autoplay: false, - autoplayDirection: 'forward', - backwardBtnProps: {}, - centerMode: false, - children: null, - containerProps: {}, - delay: 0, - disableNavIfAllVisible: true, - easing: 'linear', - forwardBtnProps: {}, - hideNavIfAllVisible: true, - innerProps: {}, - itemsListProps: {}, - itemsToScroll: 1, - itemsToShow: 0, - onAfterChange: null, - responsiveProps: [], - speed: 0, - updateOnItemClick: false, - }; - constructor(props) { super(props); @@ -478,7 +430,7 @@ class ReactSimplyCarousel extends Component { ...(isActive ? activeSlideProps : {}), }; - this.renderedSlidesCount = this.renderedSlidesCount + 1; + this.renderedSlidesCount += 1; return { props, @@ -581,11 +533,13 @@ class ReactSimplyCarousel extends Component {
{showBackwardBtn && !hideNav && (