]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Move htmllint to npm script.
authorBardi Harborow <bardi@bardiharborow.com>
Mon, 23 Jan 2017 09:38:34 +0000 (20:38 +1100)
committerBardi Harborow <bardi@bardiharborow.com>
Mon, 23 Jan 2017 09:53:17 +0000 (20:53 +1100)
Gruntfile.js
docs/.htmllintrc [new file with mode: 0644]
package.json

index 7d16ff4320f7b0d57c4de74bc043fbb203419ecc..6b5bca0efbf9a2e692bcc507edd5f06d4ca9300c 100644 (file)
@@ -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 %>',
@@ -226,6 +206,9 @@ module.exports = function (grunt) {
       htmlhint: {
         command: 'npm run htmlhint'
       },
+      htmllint: {
+        command: 'npm run htmllint'
+      },
       sass: {
         command: 'npm run sass'
       },
@@ -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
diff --git a/docs/.htmllintrc b/docs/.htmllintrc
new file mode 100644 (file)
index 0000000..2a6bb58
--- /dev/null
@@ -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
+}
index ae913bbc1db60a908b94dccb667e943cdb9cdcc8..4a5aac3db6c3e23445c84989003469e9fcf407e2 100644 (file)
@@ -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",
     "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",