Permalink
Browse files

Linting

  • Loading branch information...
nolimits4web committed Sep 20, 2017
1 parent 5ad4233 commit 1b5cfd841abfe4c286ea68bc50e41736e7d68184
View
@@ -1,2 +1,7 @@
demos/
playground/
demos
build
playground
node_modules
dist
package.js
src/swiper.js
View
@@ -136,6 +136,7 @@ function build(cb) {
const components = [];
config.components.forEach((name) => {
// eslint-disable-next-line
const capitalized = name.split('-').map((word) => {
return word.split('').map((char, index) => {
if (index === 0) return char.toUpperCase();
@@ -155,11 +156,12 @@ function build(cb) {
cbs += 1;
if (cbs === expectCbs) cb();
});
es(components, () => {
cbs += 1;
if (cbs === expectCbs) cb();
});
if (env !== 'development') {
es(components, () => {
cbs += 1;
if (cbs === expectCbs) cb();
});
}
}
module.exports = build;
View
@@ -2,7 +2,6 @@
const gulp = require('gulp');
const connect = require('gulp-connect');
const gopen = require('gulp-open');
const fs = require('fs');
const modifyFile = require('gulp-modify-file');
const buildJs = require('./build-js.js');
@@ -117,4 +117,4 @@ export default {
// Callbacks
runCallbacksOnInit: true,
}
};
@@ -97,7 +97,7 @@ export default function () {
.attr('data-swiper-column', column)
.attr('data-swiper-row', row);
}
if (slide.css('display') === 'none') continue;
if (slide.css('display') === 'none') continue; // eslint-disable-line
if (params.slidesPerView === 'auto') {
slideSize = swiper.isHorizontal() ? slide.outerWidth(true) : slide.outerHeight(true);
if (params.roundLengths) slideSize = Math.floor(slideSize);
@@ -110,14 +110,14 @@ const Mousewheel = {
if (params.forceToAxis) {
if (swiper.isHorizontal()) {
if (Math.abs(data.pixelX) > Math.abs(data.pixelY)) delta = data.pixelX * rtlFactor;
else return;
else return true;
} else if (Math.abs(data.pixelY) > Math.abs(data.pixelX)) delta = data.pixelY;
else return;
else return true;
} else {
delta = Math.abs(data.pixelX) > Math.abs(data.pixelY) ? -data.pixelX * rtlFactor : -data.pixelY;
}
if (delta === 0) return;
if (delta === 0) return true;
if (params.invert) delta = -delta;
@@ -167,7 +167,7 @@ const Mousewheel = {
if (swiper.params.autoplay && swiper.params.autoplayDisableOnInteraction) swiper.stopAutoplay();
// Return page scroll on edge positions
if (position === 0 || position === swiper.maxTranslate()) return;
if (position === 0 || position === swiper.maxTranslate()) return true;
}
if (e.preventDefault) e.preventDefault();
View
@@ -16,8 +16,8 @@ const Device = (function Device() {
phonegap: window.cordova || window.phonegap,
};
const windows = ua.match(/(Windows Phone);?[\s\/]+([\d.]+)?/);
const android = ua.match(/(Android);?[\s\/]+([\d.]+)?/);
const windows = ua.match(/(Windows Phone);?[\s\/]+([\d.]+)?/); // eslint-disable-line
const android = ua.match(/(Android);?[\s\/]+([\d.]+)?/); // eslint-disable-line
const ipad = ua.match(/(iPad).*OS\s([\d_]+)/);
const ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/);
const iphone = !ipad && ua.match(/(iPhone\sOS|iOS)\s([\d_]+)/);

0 comments on commit 1b5cfd8

Please sign in to comment.