c3b-lint 0.0.14 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/check/html.js +4 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ markdown that a tool can check, with one command and one config to install. It r
|
|
|
17
17
|
4. **HTML** on every page under `src/` (partials are skipped): doctype, `lang`, charset, viewport without
|
|
18
18
|
`user-scalable=no`, the required head set (title, description, absolute canonical, `og:*` with an absolute
|
|
19
19
|
`og:image`, `twitter:card`, one SVG favicon; a `noindex` page is excused the canonical and social tags), no external
|
|
20
|
-
stylesheets (webfonts are self-hosted), stylesheet order (`reset`, `tokens`, `main`, …, page file last),
|
|
20
|
+
stylesheets (webfonts are self-hosted; a warning, not an error), stylesheet order (`reset`, `tokens`, `main`, …, page file last),
|
|
21
21
|
the skip-link rule (`<a id="skip-link" href="#main">` first in `<body>` when there is a header or nav, absent
|
|
22
22
|
otherwise, landing on `<main id="main">` — or on the id `<main>` already has), one `<h1>`, `alt` on every image, no inline handlers, no `<style>` or `style=""`
|
|
23
23
|
(except a JS-driven custom property), relative paths only (a Barba site's links outside its container — header, menu — stay root-relative), kebab-case ids and classes, no duplicate ids,
|
package/check/html.js
CHANGED
|
@@ -128,9 +128,11 @@ function checkPage(report, file, source) {
|
|
|
128
128
|
// --- stylesheet link order: reset, tokens, main, components, page file last
|
|
129
129
|
const allSheets = headEls.filter((el) => el.name === 'link' && attr(el, 'rel') === 'stylesheet')
|
|
130
130
|
.map((el) => ({ el, href: attr(el, 'href') ?? '' }));
|
|
131
|
-
// frontend.md: webfonts are self-hosted woff2 in src/asset/font/; no stylesheet comes from another origin
|
|
131
|
+
// frontend.md: webfonts are self-hosted woff2 in src/asset/font/; no stylesheet comes from another origin.
|
|
132
|
+
// A warning, not an error: a licensed font can come with a stylesheet that has to load from the foundry
|
|
133
|
+
// (Monotype's tracking CSS), and a font still waiting on its licence shouldn't block every commit.
|
|
132
134
|
for (const sheet of allSheets.filter((s) => /^(https?:)?\/\//.test(s.href))) {
|
|
133
|
-
report.
|
|
135
|
+
report.warn(at(sheet.el), `external stylesheet ${ sheet.href } — self-host it (fonts as woff2 in src/asset/font/)`);
|
|
134
136
|
}
|
|
135
137
|
const sheets = allSheets.filter((s) => !/^(https?:)?\/\//.test(s.href));
|
|
136
138
|
const names = sheets.map((s) => basename(s.href.split('?')[0]));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "c3b-lint",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"description": "Lints a co:lab project against the rules a tool can check: ESLint, Stylelint, the 500-line limit and the shared .editorconfig; --init writes the config files.",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"type": "module",
|