add htmllint

This commit is contained in:
Simon Bruder 2018-04-24 20:22:13 +00:00
parent 67c5c82a7e
commit 9b006bb4bf
No known key found for this signature in database
GPG key ID: 6F03E0000CC5B62F
5 changed files with 203 additions and 212 deletions

6
.htmllintrc Normal file
View file

@ -0,0 +1,6 @@
{
"indent-style": "spaces",
"indent-width": 2,
"id-class-style": "dash",
"tag-bans": ["style", "b"]
}

View file

@ -1,21 +1,34 @@
const gulp = require('gulp');
const gulp = require('gulp')
// gulp plugins
const less = require('gulp-less');
const htmlmin = require('gulp-htmlmin');
const minifyCSS = require('gulp-csso');
const minify = require('gulp-minify');
const eslint = require('gulp-eslint');
const lesshint = require('gulp-lesshint');
const eslint = require('gulp-eslint')
const htmllint = require('gulp-htmllint')
const lesshint = require('gulp-lesshint')
const less = require('gulp-less')
const minifyCSS = require('gulp-csso')
const minify = require('gulp-minify')
// other packages
const browserSync = require('browser-sync').create();
// htmllint dependencies
const fancyLog = require('fancy-log')
const colors = require('ansi-colors')
// for hot reloading
const browserSync = require('browser-sync').create()
// custom reporter functions
function htmllintReporter(filepath, issues) {
issues.forEach((issue) =>
fancyLog(colors.cyan('[gulp-htmllint] ') + colors.white(filepath +
' [' + issue.line + ',' + issue.column + ']: ') + colors.red('(' +
issue.code + ') ' + issue.msg))
)
}
gulp.task('html', function(){
return gulp.src('src/index.html')
.pipe(minifyCSS())
.pipe(htmllint({}, htmllintReporter))
.pipe(gulp.dest('build'))
});
})
gulp.task('css', function(){
return gulp.src('src/less/*.less')
@ -24,16 +37,11 @@ gulp.task('css', function(){
.pipe(less())
.pipe(minifyCSS())
.pipe(gulp.dest('build/css'))
});
})
gulp.task('js', function(){
return gulp.src('src/js/*.js')
.pipe(eslint({
"globals": [
"jQuery",
"$"
]
}))
.pipe(eslint())
.pipe(eslint.format())
.pipe(minify({
ext:{
@ -42,35 +50,35 @@ gulp.task('js', function(){
}
}))
.pipe(gulp.dest('build/js'))
});
})
gulp.task('default', [ 'html', 'css', 'js' ]);
gulp.task('default', [ 'html', 'css', 'js' ])
/* DEVELOPMENT */
gulp.task('browsersync', ['default'], function() {
browserSync.init({
server: "./build"
});
})
})
gulp.task('html-watch', ['html'], function (done) {
browserSync.reload();
done();
});
browserSync.reload()
done()
})
gulp.task('css-watch', ['css'], function (done) {
browserSync.reload();
done();
});
browserSync.reload()
done()
})
gulp.task('js-watch', ['js'], function (done) {
browserSync.reload();
done();
});
browserSync.reload()
done()
})
gulp.task('watch', ['browsersync'], function(){
gulp.watch('src/index.html', ['html-watch']);
gulp.watch('src/less/*.less', ['css-watch']);
gulp.watch('src/js/*.js', ['js-watch']);
gulp.watch('src/index.html', ['html-watch'])
gulp.watch('src/less/*.less', ['css-watch'])
gulp.watch('src/js/*.js', ['js-watch'])
})

332
package-lock.json generated
View file

@ -399,8 +399,7 @@
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz",
"integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=",
"dev": true,
"optional": true
"dev": true
},
"asn1": {
"version": "0.2.3",
@ -854,53 +853,46 @@
"integrity": "sha512-83apNb8KK0Se60UE1+4Ukbe3HbfELJ6UlI4ldtOGs7So4KD26orJM8hIY9lxdzP+UpItH1Yh/Y8GUvNFWFFRxA==",
"dev": true
},
"bufferstreams": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/bufferstreams/-/bufferstreams-1.1.3.tgz",
"integrity": "sha512-HaJnVuslRF4g2kSDeyl++AaVizoitCpL9PglzCYwy0uHHyvWerfvEb8jWmYbF1z4kiVFolGomnxSGl+GUQp2jg==",
"dev": true,
"requires": {
"readable-stream": "2.3.6"
},
"dependencies": {
"isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
"dev": true
},
"readable-stream": {
"version": "2.3.6",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
"integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
"dev": true,
"requires": {
"core-util-is": "1.0.2",
"inherits": "2.0.3",
"isarray": "1.0.0",
"process-nextick-args": "2.0.0",
"safe-buffer": "5.1.1",
"string_decoder": "1.1.1",
"util-deprecate": "1.0.2"
}
},
"string_decoder": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"dev": true,
"requires": {
"safe-buffer": "5.1.1"
}
}
}
},
"builtin-modules": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz",
"integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=",
"dev": true
},
"bulk-require": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/bulk-require/-/bulk-require-1.0.1.tgz",
"integrity": "sha1-yz0DnmmBOaRE/FdLJh1rOyz0TIk=",
"dev": true,
"requires": {
"glob": "7.1.2"
},
"dependencies": {
"glob": {
"version": "7.1.2",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
"integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
"dev": true,
"requires": {
"fs.realpath": "1.0.0",
"inflight": "1.0.6",
"inherits": "2.0.3",
"minimatch": "3.0.4",
"once": "1.3.3",
"path-is-absolute": "1.0.1"
}
},
"minimatch": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"dev": true,
"requires": {
"brace-expansion": "1.1.11"
}
}
}
},
"cache-base": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz",
@ -945,16 +937,6 @@
"integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=",
"dev": true
},
"camel-case": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/camel-case/-/camel-case-3.0.0.tgz",
"integrity": "sha1-yjw2iKTpzzpM2nd9xNy8cTJJz3M=",
"dev": true,
"requires": {
"no-case": "2.3.2",
"upper-case": "1.1.3"
}
},
"camelcase": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz",
@ -1077,15 +1059,6 @@
}
}
},
"clean-css": {
"version": "4.1.11",
"resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.1.11.tgz",
"integrity": "sha1-Ls3xRaujj1R0DybO/Q/z4D4SXWo=",
"dev": true,
"requires": {
"source-map": "0.5.7"
}
},
"cli-cursor": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz",
@ -1575,6 +1548,49 @@
"esutils": "2.0.2"
}
},
"dom-serializer": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz",
"integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=",
"dev": true,
"requires": {
"domelementtype": "1.1.3",
"entities": "1.1.1"
},
"dependencies": {
"domelementtype": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz",
"integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=",
"dev": true
}
}
},
"domelementtype": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz",
"integrity": "sha1-sXrtguirWeUt2cGbF1bg/BhyBMI=",
"dev": true
},
"domhandler": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.1.tgz",
"integrity": "sha1-iS5HAAqZvlW783dP/qBWHYh5wlk=",
"dev": true,
"requires": {
"domelementtype": "1.3.0"
}
},
"domutils": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz",
"integrity": "sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==",
"dev": true,
"requires": {
"dom-serializer": "0.1.0",
"domelementtype": "1.3.0"
}
},
"dot-prop": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz",
@ -1725,6 +1741,12 @@
"has-binary2": "1.0.2"
}
},
"entities": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz",
"integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=",
"dev": true
},
"errno": {
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz",
@ -3569,49 +3591,17 @@
}
}
},
"gulp-htmlmin": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/gulp-htmlmin/-/gulp-htmlmin-4.0.0.tgz",
"integrity": "sha512-9FX2d4QbSm+4WuXughjZ6GJn4jx0C4BmyK2e+AS6567NPAetNfB+hv2ZL/88AacdC+8OS+TzeIjfKRXPSAgOYw==",
"gulp-htmllint": {
"version": "0.0.15",
"resolved": "https://registry.npmjs.org/gulp-htmllint/-/gulp-htmllint-0.0.15.tgz",
"integrity": "sha512-m5LBV6n+korK9SGqdHp7gwEIWryxMQ9Jlh7Al5BO7ogoifAHLyd7sdlACskMbTCDCP0BC9H+ewt7K9ITmeCQ8Q==",
"dev": true,
"requires": {
"bufferstreams": "1.1.3",
"html-minifier": "3.5.15",
"ansi-colors": "1.1.0",
"fancy-log": "1.3.2",
"htmllint": "0.7.2",
"plugin-error": "0.1.2",
"readable-stream": "2.3.6",
"tryit": "1.0.3"
},
"dependencies": {
"isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
"dev": true
},
"readable-stream": {
"version": "2.3.6",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
"integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
"dev": true,
"requires": {
"core-util-is": "1.0.2",
"inherits": "2.0.3",
"isarray": "1.0.0",
"process-nextick-args": "2.0.0",
"safe-buffer": "5.1.1",
"string_decoder": "1.1.1",
"util-deprecate": "1.0.2"
}
},
"string_decoder": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"dev": true,
"requires": {
"safe-buffer": "5.1.1"
}
}
"through2": "2.0.3"
}
},
"gulp-less": {
@ -4066,12 +4056,6 @@
"sntp": "2.1.0"
}
},
"he": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz",
"integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=",
"dev": true
},
"hoek": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.1.tgz",
@ -4093,41 +4077,77 @@
"integrity": "sha512-lIbgIIQA3lz5XaB6vxakj6sDHADJiZadYEJB+FgA+C4nubM1NwcuvUr9EJPmnH1skZqpqUzWborWo8EIUi0Sdw==",
"dev": true
},
"html-minifier": {
"version": "3.5.15",
"resolved": "https://registry.npmjs.org/html-minifier/-/html-minifier-3.5.15.tgz",
"integrity": "sha512-OZa4rfb6tZOZ3Z8Xf0jKxXkiDcFWldQePGYFDcgKqES2sXeWaEv9y6QQvWUtX3ySI3feApQi5uCsHLINQ6NoAw==",
"htmllint": {
"version": "0.7.2",
"resolved": "https://registry.npmjs.org/htmllint/-/htmllint-0.7.2.tgz",
"integrity": "sha1-AuR0FvotvrMLXiw+1mfopUB6jzQ=",
"dev": true,
"requires": {
"camel-case": "3.0.0",
"clean-css": "4.1.11",
"commander": "2.15.1",
"he": "1.1.1",
"param-case": "2.1.1",
"relateurl": "0.2.7",
"uglify-js": "3.3.22"
"bulk-require": "1.0.1",
"htmlparser2": "3.9.2",
"lodash": "4.17.10",
"promise": "8.0.1"
},
"dependencies": {
"commander": {
"version": "2.15.1",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz",
"integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==",
"lodash": {
"version": "4.17.10",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz",
"integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==",
"dev": true
},
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"dev": true
},
"uglify-js": {
"version": "3.3.22",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.3.22.tgz",
"integrity": "sha512-tqw96rL6/BG+7LM5VItdhDjTQmL5zG/I0b2RqWytlgeHe2eydZHuBHdA9vuGpCDhH/ZskNGcqDhivoR2xt8RIw==",
"promise": {
"version": "8.0.1",
"resolved": "https://registry.npmjs.org/promise/-/promise-8.0.1.tgz",
"integrity": "sha1-5F1osAoXZHttpxG/he1u1HII9FA=",
"dev": true,
"requires": {
"commander": "2.15.1",
"source-map": "0.6.1"
"asap": "2.0.6"
}
}
}
},
"htmlparser2": {
"version": "3.9.2",
"resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.9.2.tgz",
"integrity": "sha1-G9+HrMoPP55T+k/M6w9LTLsAszg=",
"dev": true,
"requires": {
"domelementtype": "1.3.0",
"domhandler": "2.4.1",
"domutils": "1.7.0",
"entities": "1.1.1",
"inherits": "2.0.3",
"readable-stream": "2.3.6"
},
"dependencies": {
"isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
"dev": true
},
"readable-stream": {
"version": "2.3.6",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
"integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
"dev": true,
"requires": {
"core-util-is": "1.0.2",
"inherits": "2.0.3",
"isarray": "1.0.0",
"process-nextick-args": "2.0.0",
"safe-buffer": "5.1.1",
"string_decoder": "1.1.1",
"util-deprecate": "1.0.2"
}
},
"string_decoder": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"dev": true,
"requires": {
"safe-buffer": "5.1.1"
}
}
}
@ -5499,12 +5519,6 @@
"signal-exit": "3.0.2"
}
},
"lower-case": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/lower-case/-/lower-case-1.1.4.tgz",
"integrity": "sha1-miyr0bno4K6ZOkv31YdcOcQujqw=",
"dev": true
},
"lru-cache": {
"version": "2.7.3",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz",
@ -5747,15 +5761,6 @@
"integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=",
"dev": true
},
"no-case": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/no-case/-/no-case-2.3.2.tgz",
"integrity": "sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ==",
"dev": true,
"requires": {
"lower-case": "1.1.4"
}
},
"normalize-package-data": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz",
@ -6040,15 +6045,6 @@
"integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=",
"dev": true
},
"param-case": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/param-case/-/param-case-2.1.1.tgz",
"integrity": "sha1-35T9jPZTHs915r75oIWPvHK+Ikc=",
"dev": true,
"requires": {
"no-case": "2.3.2"
}
},
"parse-filepath": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz",
@ -6658,12 +6654,6 @@
"integrity": "sha512-LOPw8FpgdQF9etWMaAfG/WRthIdXJGYp4mJ2Jgn/2lpkbod9jPn0t9UqN7AxBOKNfzRbYyVfgc7Vk4t/MpnXgw==",
"dev": true
},
"relateurl": {
"version": "0.2.7",
"resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz",
"integrity": "sha1-VNvzd+UUQKypCkzSdGANP/LYiKk=",
"dev": true
},
"remove-trailing-separator": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz",
@ -7774,12 +7764,6 @@
"integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=",
"dev": true
},
"tryit": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/tryit/-/tryit-1.0.3.tgz",
"integrity": "sha1-OTvnMKlEb9Hq1tpZoBQwjzbCics=",
"dev": true
},
"tunnel-agent": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
@ -7952,12 +7936,6 @@
}
}
},
"upper-case": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/upper-case/-/upper-case-1.1.3.tgz",
"integrity": "sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg=",
"dev": true
},
"urix": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz",

View file

@ -9,7 +9,7 @@
"gulp": "^3.9.1",
"gulp-csso": "^3.0.1",
"gulp-eslint": "^4.0.2",
"gulp-htmlmin": "^4.0.0",
"gulp-htmllint": "0.0.15",
"gulp-less": "^4.0.0",
"gulp-lesshint": "^5.0.0",
"gulp-minify": "^2.1.0"

View file

@ -93,7 +93,6 @@
<a href="mailto:membership@fablab-nea.de">membership@fablab-nea.de
</a> schicken oder ausdrucken und per Post schicken:
</p>
<p>
<pre class="address">
FabLab Bad Windsheim
Spitalwall 16