Skip to content

Commit e3f8a11

Browse files
author
jrtaylor
committed
build(gulp, eslint): gulp and eslint config updates
1 parent 655e279 commit e3f8a11

File tree

8 files changed

+164
-47
lines changed

8 files changed

+164
-47
lines changed

.eslintignore

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
8+
# Runtime data
9+
pids
10+
*.pid
11+
*.seed
12+
*.pid.lock
13+
14+
# Directory for instrumented libs generated by jscoverage/JSCover
15+
lib-cov
16+
17+
# Coverage directory used by tools like istanbul
18+
coverage
19+
20+
# nyc test coverage
21+
.nyc_output
22+
23+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24+
.grunt
25+
26+
# Bower dependency directory (https://bower.io/)
27+
bower_components
28+
29+
# node-waf configuration
30+
.lock-wscript
31+
32+
# Compiled binary addons (https://nodejs.org/api/addons.html)
33+
build/Release
34+
35+
# Dependency directories
36+
node_modules/
37+
jspm_packages/
38+
39+
# TypeScript v1 declaration files
40+
typings/
41+
42+
# Optional npm cache directory
43+
.npm
44+
45+
# Optional eslint cache
46+
.eslintcache
47+
48+
# Optional REPL history
49+
.node_repl_history
50+
51+
# Output of 'npm pack'
52+
*.tgz
53+
54+
# Yarn Integrity file
55+
.yarn-integrity
56+
57+
# dotenv environment variables file
58+
.env
59+
60+
# next.js build output
61+
.next
62+
63+
# idea files
64+
.idea
65+
66+
# dist
67+
dist/

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ module.exports = {
1515
ecmaVersion: 2018,
1616
sourceType: 'module',
1717
},
18+
1819
plugins: [
1920
'prettier'
2021
],

dist/vue-user-timeout.es5.js

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,24 @@
1-
"use strict";
2-
3-
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
1+
function _typeof(obj) {
2+
if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') {
3+
_typeof = function _typeof(obj) {
4+
return typeof obj;
5+
};
6+
} else {
7+
_typeof = function _typeof(obj) {
8+
return obj &&
9+
typeof Symbol === 'function' &&
10+
obj.constructor === Symbol &&
11+
obj !== Symbol.prototype
12+
? 'symbol'
13+
: typeof obj;
14+
};
15+
}
16+
return _typeof(obj);
17+
}
418

5-
var userTimeout = require('./lib/userTimeout');
19+
const userTimeout = require('./lib/userTimeout');
620

7-
(function () {
21+
(function() {
822
/**
923
* Install plugin
1024
* @param Vue
@@ -21,19 +35,21 @@ var userTimeout = require('./lib/userTimeout');
2135
$userTimeout: {
2236
get: function get() {
2337
return userTimeout;
24-
}
25-
}
38+
},
39+
},
2640
});
2741
} // Logic to determine how to include the plugin
2842

29-
30-
if ((typeof exports === "undefined" ? "undefined" : _typeof(exports)) == "object") {
43+
if (
44+
(typeof exports === 'undefined' ? 'undefined' : _typeof(exports)) ==
45+
'object'
46+
) {
3147
module.exports = plugin;
32-
} else if (typeof define == "function" && define.amd) {
33-
define([], function () {
48+
} else if (typeof define === 'function' && define.amd) {
49+
define([], function() {
3450
return plugin;
3551
});
3652
} else if (window.Vue && typeof window !== 'undefined') {
3753
Vue.use(plugin, options);
3854
}
39-
})();
55+
})();

dist/vue-user-timeout.min.es5.js

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,38 @@
1-
"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var userTimeout=require("./lib/userTimeout");!function(){function e(t,o){e.installed||(e.installed=!0,t.$userTimeout=userTimeout,Object.defineProperties(t.prototype,{$userTimeout:{get:function(){return userTimeout}}}))}"object"==("undefined"==typeof exports?"undefined":_typeof(exports))?module.exports=e:"function"==typeof define&&define.amd?define([],function(){return e}):window.Vue&&"undefined"!=typeof window&&Vue.use(e,options)}();
1+
function _typeof(e) {
2+
return (_typeof =
3+
typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol'
4+
? function(e) {
5+
return typeof e;
6+
}
7+
: function(e) {
8+
return e &&
9+
typeof Symbol === 'function' &&
10+
e.constructor === Symbol &&
11+
e !== Symbol.prototype
12+
? 'symbol'
13+
: typeof e;
14+
})(e);
15+
}
16+
const userTimeout = require('./lib/userTimeout');
17+
18+
!(function() {
19+
function e(t, o) {
20+
e.installed ||
21+
((e.installed = !0),
22+
(t.$userTimeout = userTimeout),
23+
Object.defineProperties(t.prototype, {
24+
$userTimeout: {
25+
get() {
26+
return userTimeout;
27+
},
28+
},
29+
}));
30+
}
31+
(typeof exports === 'undefined' ? 'undefined' : _typeof(exports)) == 'object'
32+
? (module.exports = e)
33+
: typeof define === 'function' && define.amd
34+
? define([], function() {
35+
return e;
36+
})
37+
: window.Vue && typeof window !== 'undefined' && Vue.use(e, options);
38+
})();

gulpfile.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,17 @@ const packageName = require('./package').name;
66
const webpack = require('webpack-stream');
77

88
gulp.task('default', () => {
9-
return gulp.src('src/index.js')
10-
.pipe(webpack( require('./webpack.config.js')))
11-
.pipe(babel({
12-
presets: ['@babel/preset-env']
13-
}))
9+
return gulp
10+
.src('src/index.js')
11+
.pipe(webpack(require('./webpack.config.js')))
12+
.pipe(
13+
babel({
14+
presets: ['@babel/preset-env'],
15+
})
16+
)
1417
.pipe(rename(`${packageName}.es5.js`))
1518
.pipe(gulp.dest('dist'))
1619
.pipe(uglify())
1720
.pipe(rename(`${packageName}.min.es5.js`))
1821
.pipe(gulp.dest('dist'));
19-
});
22+
});

src/index.js

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,36 @@
11
const userTimeout = require('./lib/userTimeout');
22

3-
(function () {
4-
3+
(function() {
54
/**
65
* Install plugin
76
* @param Vue
87
* @param options
98
*/
109
function plugin(Vue, axios) {
11-
1210
if (plugin.installed) {
13-
return
11+
return;
1412
}
1513
plugin.installed = true;
16-
14+
1715
Vue.$userTimeout = userTimeout;
1816

1917
Object.defineProperties(Vue.prototype, {
20-
2118
$userTimeout: {
2219
get() {
23-
return userTimeout
24-
}
25-
}
26-
27-
})
20+
return userTimeout;
21+
},
22+
},
23+
});
2824
}
2925

30-
// Logic to determine how to include the plugin
31-
if (typeof exports == "object") {
32-
module.exports = plugin
33-
} else if (typeof define == "function" && define.amd) {
34-
define([], function(){ return plugin })
35-
} else if (window.Vue && typeof window !== 'undefined') {
36-
Vue.use(plugin, options)
37-
}
38-
39-
})();
26+
// Logic to determine how to include the plugin
27+
if (typeof exports === 'object') {
28+
module.exports = plugin;
29+
} else if (typeof define === 'function' && define.amd) {
30+
define([], function() {
31+
return plugin;
32+
});
33+
} else if (window.Vue && typeof window !== 'undefined') {
34+
Vue.use(plugin, options);
35+
}
36+
})();

src/lib/userTimeout.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
export default {
2-
32
// properties
4-
test: "Test",
3+
test: 'Test',
54

65
// methods
7-
init: (options) => {
8-
9-
}
6+
init: options => {},
107
};

webpack.config.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
{
2-
3-
}
2+
}

0 commit comments

Comments
 (0)