Skip to content

Commit

Permalink
Add grunt-html for HTML validation
Browse files Browse the repository at this point in the history
Ignore v2 docs
  • Loading branch information
XhmikosR committed Sep 19, 2020
1 parent b1edb7a commit 3a36f5c
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:
${{ runner.OS }}-node-v${{ env.NODE }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}
${{ runner.OS }}-node-v${{ env.NODE }}-
- run: java -version

- name: Install npm dependencies
run: npm ci

Expand Down
17 changes: 17 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ module.exports = grunt => {
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-html');

// Force use of Unix newlines
grunt.util.linefeed = '\n';
Expand Down Expand Up @@ -148,6 +149,21 @@ module.exports = grunt => {
dest: ''
}
},
htmllint: {
options: {
ignore: [
/Attribute autocomplete is only allowed when the input type is.*/,
/Attribute autocomplete not allowed on element button at this point./,
/Bad value for attribute action on element form./
]
},
src: [
'docs/**/*.html',
'!docs/**/bower_components/**/*.html',
'!docs/_vendor/**/*.html',
'!docs/2/**/*.html'
]
},
connect: {
options: {
hostname: 'localhost',
Expand Down Expand Up @@ -238,6 +254,7 @@ module.exports = grunt => {
});

grunt.registerTask('vendor', 'copy:vendor');

grunt.registerTask('docs-css', ['sass:docs', 'postcss:docs']);

grunt.registerTask('server', 'connect:keepalive');
Expand Down
75 changes: 75 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
},
"scripts": {
"build": "grunt swatch",
"htmllint": "grunt htmllint",
"stylelint": "stylelint \"{build,dist,docs/_assets}/**/*.scss\" --rd",
"test": "npm run stylelint"
"test": "npm run stylelint && npm run htmllint"
},
"files": [
"dist/**/*.{css,scss}"
Expand All @@ -33,6 +34,7 @@
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-cssmin": "^3.0.0",
"grunt-contrib-watch": "^1.1.0",
"grunt-html": "^14.2.0",
"grunt-sass": "^3.1.0",
"jquery": "^3.5.1",
"node-sass": "^4.14.1",
Expand Down

0 comments on commit 3a36f5c

Please sign in to comment.