Skip to content

Commit eac7e06

Browse files
committed
0.1.1
- Changes to default rules to focus less on best practices enforcement and more on validation only. - Error page fixes.
1 parent 55f402d commit eac7e06

5 files changed

Lines changed: 64 additions & 44 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44

55
- Put your changes here...
66

7+
## 0.1.1
8+
9+
- Changes to default rules to focus less on best practices enforcement and more on validation only.
10+
- Error page fixes.
11+
712
## 0.1.0
813

914
- Initial version.

index.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,17 @@ module.exports = (app, params) => {
2424
const defaultRules = {
2525
extends: ['html-validate:recommended'], // use the project's recommended rules, except...
2626
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-
style: 'lowercase', // forces lowercase attributes
29-
ignoreForeign: true // except in cases of non-HTML elements, e.g. <svg viewBox="0 0 100 100">
30-
},
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+
],
3136
'attr-quotes': 'off', // allows single or double quotes
32-
'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
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
3338
'no-trailing-whitespace': 'off', // linters should enforce this, not validators
3439
'prefer-button': 'off' // this rule incorrectly disallows <input type="submit"> https://gitlab.com/html-validate/html-validate/-/issues/90
3540
}

package-lock.json

Lines changed: 33 additions & 34 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
@@ -8,7 +8,7 @@
88
"url": "https://github.com/rooseveltframework/express-html-validator/graphs/contributors"
99
}
1010
],
11-
"version": "0.1.0",
11+
"version": "0.1.1",
1212
"files": [
1313
"templates",
1414
"index.js"

test/test.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,21 @@ 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'],
197-
rules: {
198-
'attr-case': 'off',
199-
'attr-quotes': 'off'
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
200211
}
201212
})
202213
})

0 commit comments

Comments
 (0)