Skip to content

Commit b7be738

Browse files
authored
Merge pull request #13 from Autre31415/default-tweak
update validator and switch default rules to standards
2 parents cc5d57c + e8b5658 commit b7be738

4 files changed

Lines changed: 85 additions & 74 deletions

File tree

index.js

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,7 @@ module.exports = (app, params) => {
2222

2323
// default html-validate rules to use when none are passed
2424
const defaultRules = {
25-
extends: ['html-validate:recommended'], // use the project's recommended rules, except...
26-
rules: { // the defaults have some problems, so we're changing them
27-
'attr-case': [ // has to do with permitted case (uppercase or lowercase) for attributes
28-
'error',
29-
{
30-
rules: {
31-
style: 'lowercase', // forces lowercase attributes
32-
ignoreForeign: true // except in cases of non-HTML elements, e.g. <svg viewBox="0 0 100 100">
33-
}
34-
}
35-
],
36-
'attr-quotes': 'off', // allows single or double quotes
37-
'no-conditional-comment': 'off', // conditional comments are still useful sometimes and they're technically valid HTML, so there's no reason to have this rule
38-
'no-trailing-whitespace': 'off', // linters should enforce this, not validators
39-
'prefer-button': 'off' // this rule incorrectly disallows <input type="submit"> https://gitlab.com/html-validate/html-validate/-/issues/90
40-
}
25+
extends: ['html-validate:standard']
4126
}
4227

4328
/**

package-lock.json

Lines changed: 82 additions & 41 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"app-root-dir": "~1.0.2",
2626
"es6-template-strings": "~2.0.1",
2727
"fs-extra": "~9.0.0",
28-
"html-validate": "~2.22.0",
28+
"html-validate": "^2.23.0",
2929
"prismjs": "~1.20.0",
3030
"tamper": "~1.1.0"
3131
},

test/test.js

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -193,21 +193,6 @@ test('use defaults when validatorConfig is an empty object and no config file ex
193193
expressValidator(t.context.app, { rules: {} })
194194

195195
t.deepEqual(config, {
196-
extends: ['html-validate:recommended'], // use the project's recommended rules, except...
197-
rules: { // the defaults have some problems, so we're changing them
198-
'attr-case': [ // has to do with permitted case (uppercase or lowercase) for attributes
199-
'error',
200-
{
201-
rules: {
202-
style: 'lowercase', // forces lowercase attributes
203-
ignoreForeign: true // except in cases of non-HTML elements, e.g. <svg viewBox="0 0 100 100">
204-
}
205-
}
206-
],
207-
'attr-quotes': 'off', // allows single or double quotes
208-
'no-conditional-comment': 'off', // conditional comments are still useful sometimes and they're technically valid HTML, so there's no reason to have this rule
209-
'no-trailing-whitespace': 'off', // linters should enforce this, not validators
210-
'prefer-button': 'off' // this rule incorrectly disallows <input type="submit"> https://gitlab.com/html-validate/html-validate/-/issues/90
211-
}
196+
extends: ['html-validate:standard']
212197
})
213198
})

0 commit comments

Comments
 (0)