Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Commit 43b8bb7

Browse files
authored
chore(infrastructure): Add npm run lint:html for screenshot pages (#3502)
### What it does * Adds `npm run lint:html` command - Runs against `test/screenshot/spec/**/*.html` files (excluding `index.html`) * Adds root `.htmllintrc` config file - Unfortunately, [`htmllint`](https://www.npmjs.com/package/htmllint-cli) doesn't support disabling individual rules with inline comments. - However, you can disable _all_ rules with a comment block: ```html <a>Allowed tag</a> <!-- htmllint-disable --> <b>Banned tag</b> <!-- htmllint-enable --> <code>Allowed tag</code> ``` * Fixes linter errors in `button`, `card`, `drawer`, `radio`, `switch`, and `textfield` pages' * Adds `<label>` elements to `radio` and `switch` pages: ![radio page screenshot](https://user-images.githubusercontent.com/409245/45004682-845cbb80-afa3-11e8-919b-22780e2c9930.png) ![switch page screenshot](https://user-images.githubusercontent.com/409245/45004662-537c8680-afa3-11e8-8146-e8cfe60a0180.png) ### How to test ```bash npm run lint:html ```
1 parent cd28c19 commit 43b8bb7

63 files changed

Lines changed: 3455 additions & 2442 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.htmllintrc

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"attr-bans": [],
3+
"attr-name-ignore-regex": "^(viewBox)$",
4+
"attr-name-style": "dash",
5+
"attr-no-dup": true,
6+
"attr-req-value": false,
7+
"attr-validate": false,
8+
"class-no-dup": true,
9+
"class-style": "bem",
10+
"doctype-first": true,
11+
"doctype-html5": true,
12+
"fig-req-figcaption": true,
13+
"head-req-title": true,
14+
"head-valid-content-model": true,
15+
"href-style": "relative",
16+
"html-req-lang": true,
17+
"html-valid-content-model": true,
18+
"id-class-style": "bem",
19+
"id-no-dup": true,
20+
"img-req-alt": true,
21+
"img-req-src": true,
22+
"indent-delta": false,
23+
"indent-style": "spaces",
24+
"indent-width": 2,
25+
"indent-width-cont": true,
26+
"input-radio-req-name": true,
27+
"input-req-label": true,
28+
"line-max-len": 200,
29+
"line-max-len-ignore-regex": "<script|<link|<path|^\\s*<!--\\s*https?://|^\\s*https?://|^\\s*href=\"[^\"]+\"",
30+
"line-no-trailing-whitespace": false,
31+
"raw-ignore-regex": "<!--\\s*htmllint-disable\\s*-->[^]*?<!--\\s*htmllint-enable\\s*-->|<svg[^>]*>[^]*?</svg>",
32+
"tag-bans": ["b"],
33+
"tag-name-lowercase": true,
34+
"tag-name-match": true,
35+
"title-max-len": false,
36+
"title-no-dup": true
37+
}

0 commit comments

Comments
 (0)