Permalink
Browse files

Lint

  • Loading branch information...
nolimits4web committed Jan 13, 2018
1 parent 0f07546 commit 8dfe5e139ae1f6badfd9a1d1c4a344dd1203e530
View
@@ -18,6 +18,7 @@ module.exports = {
exports: 'always-multiline',
functions: 'never',
}],
'prefer-destructuring': ['off'],
},
globals: {
'window': true,
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -11,6 +11,7 @@
"dev": "NODE_ENV=development gulp build && NODE_ENV=development gulp playground && NODE_ENV=development gulp server",
"prod": "NODE_ENV=production gulp playground && NODE_ENV=production gulp server",
"lint": "eslint .",
"lint-fix": "eslint . --fix",
"test": "npm run lint && npm run build:dev"
},
"files": [
@@ -55,8 +56,8 @@
"ie >= 10"
],
"devDependencies": {
"eslint": "^4.6.1",
"eslint-config-airbnb-base": "^11.3.2",
"eslint": "^4.15.0",
"eslint-config-airbnb-base": "^12.1.0",
"eslint-plugin-import": "^2.7.0",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^4.0.0",
@@ -3,7 +3,9 @@ import Device from '../../../utils/device';
export default function () {
const swiper = this;
const { classNames, params, rtl, $el } = swiper;
const {
classNames, params, rtl, $el,
} = swiper;
const suffixes = [];
suffixes.push(params.direction);
@@ -232,7 +232,9 @@ class Swiper extends SwiperClass {
}
slidesPerViewDynamic() {
const swiper = this;
const { params, slides, slidesGrid, size: swiperSize, activeIndex } = swiper;
const {
params, slides, slidesGrid, size: swiperSize, activeIndex,
} = swiper;
let spv = 1;
if (params.centeredSlides) {
let slideSize = slides[activeIndex].swiperSlideSize;
@@ -349,7 +351,9 @@ class Swiper extends SwiperClass {
}
destroy(deleteInstance = true, cleanStyles = true) {
const swiper = this;
const { params, $el, $wrapperEl, slides } = swiper;
const {
params, $el, $wrapperEl, slides,
} = swiper;
swiper.emit('beforeDestroy');
// Init Flag
@@ -11,7 +11,9 @@ import onClick from './onClick';
function attachEvents() {
const swiper = this;
const { params, touchEvents, el, wrapperEl } = swiper;
const {
params, touchEvents, el, wrapperEl,
} = swiper;
if (process.env.TARGET !== 'desktop') {
swiper.onTouchStart = onTouchStart.bind(swiper);
@@ -58,7 +60,9 @@ function attachEvents() {
function detachEvents() {
const swiper = this;
const { params, touchEvents, el, wrapperEl } = swiper;
const {
params, touchEvents, el, wrapperEl,
} = swiper;
const target = params.touchEventsTarget === 'container' ? el : wrapperEl;
const capture = !!params.nested;
@@ -4,7 +4,9 @@ export default function (event) {
const swiper = this;
const data = swiper.touchEventsData;
const { params, touches, rtl, $wrapperEl, slidesGrid, snapGrid } = swiper;
const {
params, touches, rtl, $wrapperEl, slidesGrid, snapGrid,
} = swiper;
let e = event;
if (e.originalEvent) e = e.originalEvent;
if (data.allowTouchCallbacks) {
@@ -1,6 +1,8 @@
export default function () {
const swiper = this;
const { params, activeIndex, slides, loopedSlides, allowSlidePrev, allowSlideNext } = swiper;
const {
params, activeIndex, slides, loopedSlides, allowSlidePrev, allowSlideNext,
} = swiper;
let newIndex;
swiper.allowSlidePrev = true;
swiper.allowSlideNext = true;
@@ -5,7 +5,9 @@ export default function (index = 0, speed = this.params.speed, runCallbacks = tr
let slideIndex = index;
if (slideIndex < 0) slideIndex = 0;
const { params, snapGrid, slidesGrid, previousIndex, activeIndex, rtl, $wrapperEl } = swiper;
const {
params, snapGrid, slidesGrid, previousIndex, activeIndex, rtl, $wrapperEl,
} = swiper;
let snapIndex = Math.floor(slideIndex / params.slidesPerGroup);
if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1;
@@ -3,7 +3,9 @@ import Utils from '../../../utils/utils';
export default function (axis = this.isHorizontal() ? 'x' : 'y') {
const swiper = this;
const { params, rtl, translate, $wrapperEl } = swiper;
const {
params, rtl, translate, $wrapperEl,
} = swiper;
if (params.virtualTranslate) {
return rtl ? -translate : translate;
@@ -2,7 +2,9 @@ import Support from '../../../utils/support';
export default function (translate, byController) {
const swiper = this;
const { rtl, params, $wrapperEl, progress } = swiper;
const {
rtl, params, $wrapperEl, progress,
} = swiper;
let x = 0;
let y = 0;
const z = 0;
@@ -3,7 +3,9 @@ import Utils from '../../../utils/utils';
export default function (newActiveIndex) {
const swiper = this;
const translate = swiper.rtl ? swiper.translate : -swiper.translate;
const { slidesGrid, snapGrid, params, activeIndex: previousIndex, realIndex: previousRealIndex, snapIndex: previousSnapIndex } = swiper;
const {
slidesGrid, snapGrid, params, activeIndex: previousIndex, realIndex: previousRealIndex, snapIndex: previousSnapIndex,
} = swiper;
let activeIndex = newActiveIndex;
let snapIndex;
if (typeof activeIndex === 'undefined') {
@@ -5,7 +5,9 @@ export default function () {
const swiper = this;
const params = swiper.params;
const { $wrapperEl, size: swiperSize, rtl, wrongRTL } = swiper;
const {
$wrapperEl, size: swiperSize, rtl, wrongRTL,
} = swiper;
const slides = $wrapperEl.children(`.${swiper.params.slideClass}`);
const isVirtual = swiper.virtual && params.virtual.enabled;
const slidesLength = isVirtual ? swiper.virtual.slides.length : slides.length;
@@ -1,7 +1,9 @@
export default function () {
const swiper = this;
const { slides, params, $wrapperEl, activeIndex, realIndex } = swiper;
const {
slides, params, $wrapperEl, activeIndex, realIndex,
} = swiper;
const isVirtual = swiper.virtual && params.virtual.enabled;
slides.removeClass(`${params.slideActiveClass} ${params.slideNextClass} ${params.slidePrevClass} ${params.slideDuplicateActiveClass} ${params.slideDuplicateNextClass} ${params.slideDuplicatePrevClass}`);
@@ -5,7 +5,9 @@ import Utils from '../../utils/utils';
const Coverflow = {
setTranslate() {
const swiper = this;
const { width: swiperWidth, height: swiperHeight, slides, $wrapperEl, slidesSizesGrid } = swiper;
const {
width: swiperWidth, height: swiperHeight, slides, $wrapperEl, slidesSizesGrid,
} = swiper;
const params = swiper.params.coverflowEffect;
const isHorizontal = swiper.isHorizontal();
const transform = swiper.translate;
@@ -5,7 +5,9 @@ import Browser from '../../utils/browser';
const Cube = {
setTranslate() {
const swiper = this;
const { $el, $wrapperEl, slides, width: swiperWidth, height: swiperHeight, rtl, size: swiperSize } = swiper;
const {
$el, $wrapperEl, slides, width: swiperWidth, height: swiperHeight, rtl, size: swiperSize,
} = swiper;
const params = swiper.params.cubeEffect;
const isHorizontal = swiper.isHorizontal();
const isVirtual = swiper.virtual && swiper.params.virtual.enabled;
@@ -68,7 +68,9 @@ const Lazy = {
},
load() {
const swiper = this;
const { $wrapperEl, params: swiperParams, slides, activeIndex } = swiper;
const {
$wrapperEl, params: swiperParams, slides, activeIndex,
} = swiper;
const isVirtual = swiper.virtual && swiperParams.virtual.enabled;
const params = swiperParams.lazy;
@@ -50,7 +50,9 @@ const Parallax = {
},
setTranslate() {
const swiper = this;
const { $el, slides, progress, snapGrid } = swiper;
const {
$el, slides, progress, snapGrid,
} = swiper;
$el.children('[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]')
.each((index, el) => {
swiper.parallax.setTransform(el, progress);
@@ -7,7 +7,9 @@ const Scrollbar = {
const swiper = this;
if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return;
const { scrollbar, rtl, progress } = swiper;
const { dragSize, trackSize, $dragEl, $el } = scrollbar;
const {
dragSize, trackSize, $dragEl, $el,
} = scrollbar;
const params = swiper.params.scrollbar;
let newSize = dragSize;

0 comments on commit 8dfe5e1

Please sign in to comment.