Update eslint-config-airbnb-base to the latest version 🚀 (#293)

* chore(package): update eslint-config-airbnb-base to version 14.0.0

* Fix linting
pull/299/head
greenkeeper[bot] 5 years ago committed by Glen Cheney
parent 269d87bf56
commit 1aabb4ac24

5
dist/shuffle.js vendored

@ -542,6 +542,7 @@
*/ */
function sorter(arr, options) { function sorter(arr, options) {
// eslint-disable-next-line prefer-object-spread
var opts = Object.assign({}, defaults, options); var opts = Object.assign({}, defaults, options);
var original = Array.from(arr); var original = Array.from(arr);
var revert = false; var revert = false;
@ -894,7 +895,8 @@
_classCallCheck(this, Shuffle); _classCallCheck(this, Shuffle);
_this = _possibleConstructorReturn(this, _getPrototypeOf(Shuffle).call(this)); _this = _possibleConstructorReturn(this, _getPrototypeOf(Shuffle).call(this)); // eslint-disable-next-line prefer-object-spread
_this.options = Object.assign({}, Shuffle.options, options); // Allow misspelling of delimiter since that's how it used to be. _this.options = Object.assign({}, Shuffle.options, options); // Allow misspelling of delimiter since that's how it used to be.
// Remove in v6. // Remove in v6.
@ -1581,6 +1583,7 @@
key: "getStylesForTransition", key: "getStylesForTransition",
value: function getStylesForTransition(item, styleObject) { value: function getStylesForTransition(item, styleObject) {
// Clone the object to avoid mutating the original. // Clone the object to avoid mutating the original.
// eslint-disable-next-line prefer-object-spread
var styles = Object.assign({}, styleObject); var styles = Object.assign({}, styleObject);
if (this.options.useTransforms) { if (this.options.useTransforms) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1 +1 @@
.picture-item{height:220px;margin-top:24px;margin-left:0}.picture-item img{display:block;width:100%}@supports ((-o-object-fit:cover) or (object-fit:cover)){.picture-item img{max-width:none;height:100%;-o-object-fit:cover;object-fit:cover}}.picture-item--h2{height:464px}.picture-item__inner{position:relative;height:100%;overflow:hidden;background:#ecf0f1}img.picture-item__blur{display:none}.picture-item__details{display:flex;align-items:baseline;justify-content:space-between;width:100%;padding:1em}.picture-item__description{width:100%;padding:0 2em 1em 1em;margin:0}.picture-item__title{flex-shrink:0;margin-right:4px}.picture-item__tags{flex-shrink:1;text-align:right;margin:0}@media screen and (min-width:768px){.picture-item--overlay .picture-item__details{position:absolute;bottom:0;left:0;width:100%;background-color:rgba(0,0,0,.6);color:#fff;overflow:hidden}.picture-item--overlay .picture-item__description{display:none}@supports ((-webkit-filter:blur(1px)) or (filter:blur(1px))) and ((-webkit-clip-path:inset(0 0 0 0)) or (clip-path:inset(0 0 0 0))){.picture-item--overlay .picture-item__blur{position:absolute;z-index:1;top:0;left:0;display:block;-webkit-filter:blur(7px);filter:blur(7px);-webkit-clip-path:inset(170px 0 0 0);clip-path:inset(170px 0 0 0)}.picture-item--overlay .picture-item__details{background:none}.picture-item--overlay .picture-item__tags,.picture-item--overlay .picture-item__title{position:relative;z-index:2}}}.my-shuffle-container{position:relative;overflow:hidden}.my-sizer-element{position:absolute;opacity:0;visibility:hidden}.shuffle--animatein{overflow:visible}.shuffle--animatein .picture-item__inner{opacity:0;-webkit-transform:translateY(220px);transform:translateY(220px)}.shuffle--animatein .picture-item__inner--transition{transition:all .6s ease}.shuffle--animatein .picture-item.in .picture-item__inner{opacity:1;-webkit-transform:translate(0);transform:translate(0)}@media screen and (max-width:767px){.picture-item{height:auto;margin-top:20px}.picture-item__description,.picture-item__details{font-size:.875em;padding:.625em}.picture-item__description{padding-right:.875em;padding-bottom:1.25em}.picture-item--h2{height:auto}} .picture-item{height:220px;margin-top:24px;margin-left:0}.picture-item img{display:block;width:100%}@supports ((-o-object-fit:cover) or (object-fit:cover)){.picture-item img{max-width:none;height:100%;-o-object-fit:cover;object-fit:cover}}.picture-item--h2{height:464px}.picture-item__inner{position:relative;height:100%;overflow:hidden;background:#ecf0f1}img.picture-item__blur{display:none}.picture-item__details{display:flex;align-items:baseline;justify-content:space-between;width:100%;padding:1em}.picture-item__description{width:100%;padding:0 2em 1em 1em;margin:0}.picture-item__title{flex-shrink:0;margin-right:4px}.picture-item__tags{flex-shrink:1;text-align:right;margin:0}@media screen and (min-width:768px){.picture-item--overlay .picture-item__details{position:absolute;bottom:0;left:0;width:100%;background-color:rgba(0,0,0,.6);color:#fff;overflow:hidden}.picture-item--overlay .picture-item__description{display:none}@supports ((-webkit-filter:blur(1px)) or (filter:blur(1px))) and ((-webkit-clip-path:inset(0 0 0 0)) or (clip-path:inset(0 0 0 0))){.picture-item--overlay .picture-item__blur{position:absolute;z-index:1;top:0;left:0;display:block;-webkit-filter:blur(7px);filter:blur(7px);-webkit-clip-path:inset(170px 0 0 0);clip-path:inset(170px 0 0 0)}.picture-item--overlay .picture-item__details{background:none}.picture-item--overlay .picture-item__tags,.picture-item--overlay .picture-item__title{position:relative;z-index:2}}}.my-shuffle-container{position:relative;overflow:hidden}.my-sizer-element{position:absolute;opacity:0;visibility:hidden}.shuffle--animatein{overflow:visible}.shuffle--animatein .picture-item__inner{opacity:0;transform:translateY(220px)}.shuffle--animatein .picture-item__inner--transition{transition:all .6s ease}.shuffle--animatein .picture-item.in .picture-item__inner{opacity:1;transform:translate(0)}@media screen and (max-width:767px){.picture-item{height:auto;margin-top:20px}.picture-item__description,.picture-item__details{font-size:.875em;padding:.625em}.picture-item__description{padding-right:.875em;padding-bottom:1.25em}.picture-item--h2{height:auto}}

File diff suppressed because one or more lines are too long

@ -542,6 +542,7 @@
*/ */
function sorter(arr, options) { function sorter(arr, options) {
// eslint-disable-next-line prefer-object-spread
var opts = Object.assign({}, defaults, options); var opts = Object.assign({}, defaults, options);
var original = Array.from(arr); var original = Array.from(arr);
var revert = false; var revert = false;
@ -894,7 +895,8 @@
_classCallCheck(this, Shuffle); _classCallCheck(this, Shuffle);
_this = _possibleConstructorReturn(this, _getPrototypeOf(Shuffle).call(this)); _this = _possibleConstructorReturn(this, _getPrototypeOf(Shuffle).call(this)); // eslint-disable-next-line prefer-object-spread
_this.options = Object.assign({}, Shuffle.options, options); // Allow misspelling of delimiter since that's how it used to be. _this.options = Object.assign({}, Shuffle.options, options); // Allow misspelling of delimiter since that's how it used to be.
// Remove in v6. // Remove in v6.
@ -1581,6 +1583,7 @@
key: "getStylesForTransition", key: "getStylesForTransition",
value: function getStylesForTransition(item, styleObject) { value: function getStylesForTransition(item, styleObject) {
// Clone the object to avoid mutating the original. // Clone the object to avoid mutating the original.
// eslint-disable-next-line prefer-object-spread
var styles = Object.assign({}, styleObject); var styles = Object.assign({}, styleObject);
if (this.options.useTransforms) { if (this.options.useTransforms) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -54,7 +54,7 @@
"autoprefixer": "^9.5.1", "autoprefixer": "^9.5.1",
"cssnano": "^4.1.10", "cssnano": "^4.1.10",
"eslint": "^6.0.0", "eslint": "^6.0.0",
"eslint-config-airbnb-base": "^13.1.0", "eslint-config-airbnb-base": "^14.0.0",
"eslint-plugin-import": "^2.17.3", "eslint-plugin-import": "^2.17.3",
"gulp": "^4.0.2", "gulp": "^4.0.2",
"gulp-postcss": "^8.0.0", "gulp-postcss": "^8.0.0",

@ -166,7 +166,7 @@ export function getCenteredPositions(itemRects, containerWidth) {
const newRect = new Rect(r.left + offset, r.top, r.width, r.height, r.id); const newRect = new Rect(r.left + offset, r.top, r.width, r.height, r.id);
// Check all current rects to make sure none overlap. // Check all current rects to make sure none overlap.
const noOverlap = !rects.some(r => Rect.intersects(newRect, r)); const noOverlap = !rects.some((r) => Rect.intersects(newRect, r));
newRects.push(newRect); newRects.push(newRect);
return noOverlap; return noOverlap;
@ -183,7 +183,7 @@ export function getCenteredPositions(itemRects, containerWidth) {
// elements could be in the way). // elements could be in the way).
if (!canMove) { if (!canMove) {
let intersectingRect; let intersectingRect;
const hasOverlap = itemRects.some(itemRect => rects.some((r) => { const hasOverlap = itemRects.some((itemRect) => rects.some((r) => {
const intersects = Rect.intersects(itemRect, r); const intersects = Rect.intersects(itemRect, r);
if (intersects) { if (intersects) {
intersectingRect = r; intersectingRect = r;
@ -193,7 +193,7 @@ export function getCenteredPositions(itemRects, containerWidth) {
// If there is any overlap, replace the overlapping row with the original. // If there is any overlap, replace the overlapping row with the original.
if (hasOverlap) { if (hasOverlap) {
const rowIndex = centeredRows.findIndex(items => items.includes(intersectingRect)); const rowIndex = centeredRows.findIndex((items) => items.includes(intersectingRect));
centeredRows.splice(rowIndex, 1, rows[rowIndex]); centeredRows.splice(rowIndex, 1, rows[rowIndex]);
} }
} }
@ -208,5 +208,5 @@ export function getCenteredPositions(itemRects, containerWidth) {
// Remove the wrapper object with index, map to a Point. // Remove the wrapper object with index, map to a Point.
return [].concat.apply([], centeredRows) // eslint-disable-line prefer-spread return [].concat.apply([], centeredRows) // eslint-disable-line prefer-spread
.sort((a, b) => (a.id - b.id)) .sort((a, b) => (a.id - b.id))
.map(itemRect => new Point(itemRect.left, itemRect.top)); .map((itemRect) => new Point(itemRect.left, itemRect.top));
} }

@ -37,6 +37,7 @@ class Shuffle extends TinyEmitter {
*/ */
constructor(element, options = {}) { constructor(element, options = {}) {
super(); super();
// eslint-disable-next-line prefer-object-spread
this.options = Object.assign({}, Shuffle.options, options); this.options = Object.assign({}, Shuffle.options, options);
// Allow misspelling of delimiter since that's how it used to be. // Allow misspelling of delimiter since that's how it used to be.
@ -323,7 +324,7 @@ class Shuffle extends TinyEmitter {
// Allow users to transtion other properties if they exist in the `before` // Allow users to transtion other properties if they exist in the `before`
// css mapping of the shuffle item. // css mapping of the shuffle item.
const cssProps = Object.keys(ShuffleItem.Css.HIDDEN.before).map(k => hyphenate(k)); const cssProps = Object.keys(ShuffleItem.Css.HIDDEN.before).map((k) => hyphenate(k));
const properties = positionProps.concat(cssProps).join(); const properties = positionProps.concat(cssProps).join();
items.forEach((item) => { items.forEach((item) => {
@ -335,8 +336,8 @@ class Shuffle extends TinyEmitter {
_getItems() { _getItems() {
return Array.from(this.element.children) return Array.from(this.element.children)
.filter(el => matches(el, this.options.itemSelector)) .filter((el) => matches(el, this.options.itemSelector))
.map(el => new ShuffleItem(el)); .map((el) => new ShuffleItem(el));
} }
/** /**
@ -354,11 +355,11 @@ class Shuffle extends TinyEmitter {
} }
_getFilteredItems() { _getFilteredItems() {
return this.items.filter(item => item.isVisible); return this.items.filter((item) => item.isVisible);
} }
_getConcealedItems() { _getConcealedItems() {
return this.items.filter(item => !item.isVisible); return this.items.filter((item) => !item.isVisible);
} }
/** /**
@ -556,7 +557,7 @@ class Shuffle extends TinyEmitter {
// If no transforms are going to happen, simply return an array of the // If no transforms are going to happen, simply return an array of the
// future points of each item. // future points of each item.
return items.map(item => this._getItemPosition(Shuffle.getSize(item.element, true))); return items.map((item) => this._getItemPosition(Shuffle.getSize(item.element, true)));
} }
/** /**
@ -650,6 +651,7 @@ class Shuffle extends TinyEmitter {
*/ */
getStylesForTransition(item, styleObject) { getStylesForTransition(item, styleObject) {
// Clone the object to avoid mutating the original. // Clone the object to avoid mutating the original.
// eslint-disable-next-line prefer-object-spread
const styles = Object.assign({}, styleObject); const styles = Object.assign({}, styleObject);
if (this.options.useTransforms) { if (this.options.useTransforms) {
@ -732,7 +734,7 @@ class Shuffle extends TinyEmitter {
this.isTransitioning = true; this.isTransitioning = true;
// Create an array of functions to be called. // Create an array of functions to be called.
const callbacks = transitions.map(obj => this._getTransitionFunction(obj)); const callbacks = transitions.map((obj) => this._getTransitionFunction(obj));
parallel(callbacks, this._movementFinished.bind(this)); parallel(callbacks, this._movementFinished.bind(this));
} }
@ -755,7 +757,7 @@ class Shuffle extends TinyEmitter {
*/ */
_styleImmediately(objects) { _styleImmediately(objects) {
if (objects.length) { if (objects.length) {
const elements = objects.map(obj => obj.item.element); const elements = objects.map((obj) => obj.item.element);
Shuffle._skipTransitions(elements, () => { Shuffle._skipTransitions(elements, () => {
objects.forEach((obj) => { objects.forEach((obj) => {
@ -855,7 +857,7 @@ class Shuffle extends TinyEmitter {
* @param {Element[]} newItems Collection of new items. * @param {Element[]} newItems Collection of new items.
*/ */
add(newItems) { add(newItems) {
const items = arrayUnique(newItems).map(el => new ShuffleItem(el)); const items = arrayUnique(newItems).map((el) => new ShuffleItem(el));
// Add classes and set initial positions. // Add classes and set initial positions.
this._initItems(items); this._initItems(items);
@ -867,7 +869,7 @@ class Shuffle extends TinyEmitter {
const sortedItems = sorter(allItems, this.lastSort); const sortedItems = sorter(allItems, this.lastSort);
const allSortedItemsSet = this._filter(this.lastFilter, sortedItems); const allSortedItemsSet = this._filter(this.lastFilter, sortedItems);
const isNewItem = item => items.includes(item); const isNewItem = (item) => items.includes(item);
const applyHiddenState = (item) => { const applyHiddenState = (item) => {
item.scale = ShuffleItem.Scale.HIDDEN; item.scale = ShuffleItem.Scale.HIDDEN;
item.isHidden = true; item.isHidden = true;
@ -937,8 +939,8 @@ class Shuffle extends TinyEmitter {
const collection = arrayUnique(elements); const collection = arrayUnique(elements);
const oldItems = collection const oldItems = collection
.map(element => this.getItemByElement(element)) .map((element) => this.getItemByElement(element))
.filter(item => !!item); .filter((item) => !!item);
const handleLayout = () => { const handleLayout = () => {
this._disposeItems(oldItems); this._disposeItems(oldItems);
@ -963,7 +965,7 @@ class Shuffle extends TinyEmitter {
// Update the list of items here because `remove` could be called again // Update the list of items here because `remove` could be called again
// with an item that is in the process of being removed. // with an item that is in the process of being removed.
this.items = this.items.filter(item => !oldItems.includes(item)); this.items = this.items.filter((item) => !oldItems.includes(item));
this._updateItemCount(); this._updateItemCount();
this.once(Shuffle.EventType.LAYOUT, handleLayout); this.once(Shuffle.EventType.LAYOUT, handleLayout);
@ -975,7 +977,7 @@ class Shuffle extends TinyEmitter {
* @return {?ShuffleItem} A shuffle item or undefined if it's not found. * @return {?ShuffleItem} A shuffle item or undefined if it's not found.
*/ */
getItemByElement(element) { getItemByElement(element) {
return this.items.find(item => item.element === element); return this.items.find((item) => item.element === element);
} }
/** /**

@ -44,6 +44,7 @@ const defaults = {
* @return {Array<T>} * @return {Array<T>}
*/ */
export default function sorter(arr, options) { export default function sorter(arr, options) {
// eslint-disable-next-line prefer-object-spread
const opts = Object.assign({}, defaults, options); const opts = Object.assign({}, defaults, options);
const original = Array.from(arr); const original = Array.from(arr);
let revert = false; let revert = false;

Loading…
Cancel
Save