Skip to content

Commit 55f402d

Browse files
kethinovAutre31415
andauthored
Default rule changes (#7)
* WIP: default rule changes * style changes to error page * removed details and summary wip Co-authored-by: Troy Coutu <Autre31415@gmail.com>
1 parent 5ff6f58 commit 55f402d

2 files changed

Lines changed: 13 additions & 6 deletions

File tree

index.js

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

2323
// default html-validate rules to use when none are passed
2424
const defaultRules = {
25-
extends: ['html-validate:recommended'],
26-
rules: {
27-
'attr-case': 'off',
28-
'attr-quotes': 'off'
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+
style: 'lowercase', // forces lowercase attributes
29+
ignoreForeign: true // except in cases of non-HTML elements, e.g. <svg viewBox="0 0 100 100">
30+
},
31+
'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
33+
'no-trailing-whitespace': 'off', // linters should enforce this, not validators
34+
'prefer-button': 'off' // this rule incorrectly disallows <input type="submit"> https://gitlab.com/html-validate/html-validate/-/issues/90
2935
}
3036
}
3137

templates/errorPage.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
<main>
1111
<article>
1212
<style>
13+
/* prism styles */
1314
${prismStyle}
15+
16+
/* roosevelt customizations */
1417
h1 {
1518
color: #000;
1619
}
@@ -49,10 +52,8 @@
4952
.markup {
5053
font-family: monospace;
5154
background-color: #fff;
52-
overflow: hidden;
5355
padding: 0.5em;
5456
border-radius: .25em;
55-
box-shadow: .1em .1em .5em rgba(0,0,0,.45);
5657
line-height: 0;
5758
counter-reset: line;
5859
}

0 commit comments

Comments
 (0)