Skip to content

Commit 2f6087c

Browse files
authored
fixture: hbs rules to allow template class name formation and some typos (#2481)
Now if you run with `npm run test` locally, we've got some errors of page checkings: 1. layouts/partials/footer.hbs: line 3, col 20, value must match the format: dash => This problem is caused by the special formation in {{...}}, because this is an hbs file, just like Angular or some template pages, we SHOULDN'T check its variable name, so ignore it by setting: id-class-ignore-regex": "{{.*?}}" in the '.htmllintrc'. 2. layouts/partials/footer.hbs: line 3, col 1, tag is not closed => Add spaces between some tag names. 3. layouts/partials/navigation.hbs: line 6, col 11, tag is not closed => Add spaces between some tag names. 4. layouts/partials/header.hbs: line 10, col 9, tag is not closed => Add spaces between some tag names.
1 parent 4936031 commit 2f6087c

File tree

5 files changed

+5
-4
lines changed

5 files changed

+5
-4
lines changed

.htmllintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"attr-quote-style": false,
66
"attr-req-value": false,
77
"id-class-style": "dash",
8+
"id-class-ignore-regex": "{{.*?}}",
89
"img-req-alt": false,
910
"indent-style": "spaces",
1011
"indent-width": 2,

layouts/partials/footer.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<a href="#" id="scroll-to-top">&uarr; <span>{{site.scrollToTop}}</span></a>
22

3-
<footer{{#if className}} class="{{className}}"{{/if}}>
3+
<footer {{#if className}} class="{{className}}"{{/if}}>
44

55
<div class="container">
66
<div class="linuxfoundation-footer">

layouts/partials/header.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<nav>
99
<ul class="list-divider-pipe">
10-
<li{{#equals path ''}} class="active"{{/equals}}>
10+
<li {{#equals path ''}} class="active" {{/equals}}>
1111
<a href="/{{site.locale}}/">{{site.home.text}}</a>
1212
</li>
1313

layouts/partials/navigation.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{{#each nav}}
44
{{#equals @key ../key}}
55
{{#each this}}
6-
<li{{#equals ../../path link}} class="active"{{/equals}}>
6+
<li {{#equals ../../path link}} class="active" {{/equals}}>
77
{{#startswith link '/'}}
88
<a href="{{link}}">{{text}}{{#if subtext}} <span class="small color-lightgray">{{subtext}}</span>{{/if}}</a>
99
{{else}}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"load-schedule": "curl -sS https://raw.githubusercontent.com/nodejs/Release/master/schedule.json -o source/schedule.json",
1515
"start": "npm run serve",
1616
"test": "npm run test:lint && npm run test:unit && npm run test:smoke",
17-
"test:lint": "standard --fix && htmllint **/*.hbs && stylint layouts/css && markdownlint \"**/*.md\" -i \"node_modules/\"",
17+
"test:lint": "standard --fix && htmllint \"**/*.hbs\" && stylint layouts/css && markdownlint \"**/*.md\" -i \"node_modules/\"",
1818
"test:unit": "tape tests/**/*.test.js | faucet",
1919
"test:smoke": "tape tests/*.smoketest.js | faucet"
2020
},

0 commit comments

Comments
 (0)