0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-12-01 13:24:25 +01:00

Add HTMLHint to the build; fixes #20297 (#20301)

[skip sauce]
This commit is contained in:
Chris Rebert 2016-07-14 16:22:56 -07:00 committed by GitHub
parent 610a089054
commit 0cf5204a48
3 changed files with 21 additions and 1 deletions

View File

@ -278,6 +278,9 @@ module.exports = function (grunt) {
'postcss-docs': {
command: 'npm run postcss-docs'
},
htmlhint: {
command: 'npm run htmlhint'
},
'upload-preview': {
command: './grunt/upload-preview.sh'
}
@ -327,7 +330,7 @@ module.exports = function (grunt) {
require('time-grunt')(grunt);
// Docs HTML validation task
grunt.registerTask('validate-html', ['jekyll:docs', 'htmllint']);
grunt.registerTask('validate-html', ['jekyll:docs', 'htmllint', 'exec:htmlhint']);
var runSubset = function (subset) {
return !process.env.TWBS_TEST || process.env.TWBS_TEST === subset;

15
docs/.htmlhintrc Normal file
View File

@ -0,0 +1,15 @@
{
"attr-lowercase": true,
"attr-no-duplication": true,
"alt-require": true,
"attr-unsafe-chars": true,
"attr-value-double-quotes": true,
"doctype-first": true,
"doctype-html5": true,
"id-unique": true,
"spec-char-escape": true,
"src-not-empty": true,
"tag-pair": true,
"tagname-lowercase": true,
"title-require": true
}

View File

@ -20,6 +20,7 @@
"change-version": "node grunt/change-version.js",
"eslint": "eslint --config js/.eslintrc.json js/src",
"jscs": "jscs --config=js/.jscsrc js/src js/tests/unit docs/assets/js/src grunt Gruntfile.js docs/assets/js/ie-emulation-modes-warning.js docs/assets/js/ie10-viewport-bug-workaround.js",
"htmlhint": "htmlhint --config docs/.htmlhintrc _gh_pages/",
"postcss": "postcss --config grunt/postcss.js --replace dist/css/*.css",
"postcss-docs": "postcss --config grunt/postcss.js --no-map --replace docs/assets/css/docs.min.css && postcss --config grunt/postcss.js --no-map --replace docs/examples/**/*.css",
"shrinkwrap": "npm shrinkwrap --dev && shx mv ./npm-shrinkwrap.json ./grunt/npm-shrinkwrap.json",
@ -64,6 +65,7 @@
"grunt-saucelabs": "^9.0.0",
"grunt-scss-lint": "^0.3.8",
"grunt-stamp": "^0.3.0",
"htmlhint": "^0.9.13",
"is-travis": "^1.0.0",
"jscs": "^3.0.4",
"load-grunt-tasks": "^3.4.0",