Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move htmllint to npm script. #21816

Merged
merged 1 commit into from
Jan 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 4 additions & 21 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,26 +162,6 @@ module.exports = function (grunt) {
}
},

htmllint: {
options: {
ignore: [
'Attribute “autocomplete” is only allowed when the input type is “color”, “date”, “datetime”, “datetime-local”, “email”, “hidden”, “month”, “number”, “password”, “range”, “search”, “tel”, “text”, “time”, “url”, or “week”.',
'Attribute “autocomplete” not allowed on element “button” at this point.',
'Consider using the “h1” element as a top-level heading only (all “h1” elements are treated as top-level headings by many screen readers and other tools).',
'Element “div” not allowed as child of element “progress” in this context. (Suppressing further errors from this subtree.)',
'Element “img” is missing required attribute “src”.',
'The “color” input type is not supported in all browsers. Please be sure to test, and consider using a polyfill.',
'The “date” input type is not supported in all browsers. Please be sure to test, and consider using a polyfill.',
'The “datetime” input type is not supported in all browsers. Please be sure to test, and consider using a polyfill.',
'The “datetime-local” input type is not supported in all browsers. Please be sure to test, and consider using a polyfill.',
'The “month” input type is not supported in all browsers. Please be sure to test, and consider using a polyfill.',
'The “time” input type is not supported in all browsers. Please be sure to test, and consider using a polyfill.',
'The “week” input type is not supported in all browsers. Please be sure to test, and consider using a polyfill.'
]
},
src: ['_gh_pages/**/*.html', 'js/tests/visual/*.html']
},

watch: {
src: {
files: '<%= concat.bootstrap.src %>',
Expand Down Expand Up @@ -226,6 +206,9 @@ module.exports = function (grunt) {
htmlhint: {
command: 'npm run htmlhint'
},
htmllint: {
command: 'npm run htmllint'
},
sass: {
command: 'npm run sass'
},
Expand Down Expand Up @@ -288,7 +271,7 @@ module.exports = function (grunt) {
require('time-grunt')(grunt)

// Docs HTML validation task
grunt.registerTask('validate-html', ['jekyll:docs', 'htmllint', 'exec:htmlhint'])
grunt.registerTask('validate-html', ['jekyll:docs', 'exec:htmllint', 'exec:htmlhint'])

var runSubset = function (subset) {
return !process.env.TWBS_TEST || process.env.TWBS_TEST === subset
Expand Down
18 changes: 18 additions & 0 deletions docs/.htmllintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"attr-bans": ["align", "background", "bgcolor", "border", "frameborder", "longdesc", "marginwidth", "marginheight", "scrolling"],
"attr-name-style": "dash",
"attr-no-unsafe-char": false,
"class-style": "dash",
"doctype-first": true,
"doctype-html5": true,
"fig-req-figcaption": true,
"html-valid-content-model": false,
"id-class-ignore-regex": "(onclick|content|[a-z]+([A-Z][a-z])+)",
"id-class-style": "dash",
"img-req-alt": false,
"indent-style": "spaces",
"indent-width": 2,
"spec-char-escape": false,
"tag-bans": ["b", "i"],
"title-max-len": false
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"clean-css-docs": "cleancss --skip-advanced --source-map --output docs/assets/css/docs.min.css docs/assets/css/docs.min.css",
"eslint": "eslint --ignore-path .eslintignore js && eslint --config js/tests/.eslintrc.json --env node grunt Gruntfile.js && eslint --config js/tests/.eslintrc.json docs/assets/js/src docs/assets/js/ie-emulation-modes-warning.js docs/assets/js/ie10-viewport-bug-workaround.js",
"htmlhint": "htmlhint --config docs/.htmlhintrc _gh_pages/",
"htmllint": "htmllint --rc docs/.htmllintrc _gh_pages/**/*.html js/tests/visual/*.html",
"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",
"sass": "node-sass --output-style expanded --source-map true --precision 6 scss/bootstrap.scss dist/css/bootstrap.css && node-sass --output-style expanded --source-map true --precision 6 scss/bootstrap-grid.scss dist/css/bootstrap-grid.css && node-sass --output-style expanded --source-map true --precision 6 scss/bootstrap-reboot.scss dist/css/bootstrap-reboot.css",
Expand Down Expand Up @@ -66,11 +67,11 @@
"grunt-contrib-qunit": "^1.2.0",
"grunt-contrib-watch": "^1.0.0",
"grunt-exec": "^1.0.1",
"grunt-html": "^8.1.0",
"grunt-jekyll": "^0.4.4",
"grunt-saucelabs": "^9.0.0",
"grunt-stamp": "^0.3.0",
"htmlhint": "^0.9.13",
"htmllint-cli": "0.0.6",
"is-travis": "^1.0.0",
"load-grunt-tasks": "^3.5.2",
"node-sass": "^4.1.1",
Expand Down