djlint run locally reports 54 findings that MegaLinter's HTML_DJLINT never surfaces
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 52/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- html
- 领域
- ci-cd, testing-qa, web-dev
调研方向
首先使用 .djlintrc 运行 djlint --lint *.html,然后检查 MegaLinter 如何调用 HTML_DJLINT,并将其规则集与本地命令进行比较。查看 CLAUDE.md、.djlintrc 和 sitemap.html;当本地和 CI 的行为是有意设计的并且已有文档记录,且 H006 和 H031 已修复或被明确忽略时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Found incidentally while checking whether an inline onerror on a script tag would trip an HTML rule (#94 / #108). Not caused by that change - it reproduces identically on master.
What happens
Running djlint over the pages the way .djlintrc configures it:
$ djlint --lint *.html
...
Linted 16 files, found 54 errors.
54 findings, all pre-existing:
- H006 (53) -
Img tag should have height and width attributes, on essentially every<img>on the site, banner/spotlight heroes and gallery thumbs alike. - H031 (1) -
Consider adding meta keywords, onsitemap.htmlonly. Every other page has the meta tag;sitemap.htmldoes not.
MegaLinter is green on master and green on #108, so HTML_DJLINT as MegaLinter invokes it is evidently not running --lint, or is running it with a different rule set. Verified by exporting masters HTML plus .djlintrc to a clean directory and linting there: same 54, same set.
Why it is worth a look
Two separate things, and they want separating:
- The gate does not do what the docs imply.
CLAUDE.mdsays the pre-commit hooks are the fast local subset and "full linting is MegaLinter in CI". Anyone who takes that at face value, runs djlint locally to check their HTML before pushing, and gets 54 errors will either assume they broke something or conclude djlint is noise and stop running it. WhicheverHTML_DJLINTis actually doing, the discrepancy should be deliberate and written down. - H006 is not purely cosmetic. Missing intrinsic dimensions on the hero and gallery images means the browser cannot reserve space before the image decodes, which is layout shift on exactly the sections #85, #87 and #92 were about. The
.imagecontainers may already be sized in CSS, in which case the finding is genuinely moot here and the rule should be added to theignorelist in.djlintrcnext to H021 and H023, with the reason - rather than left to fail silently for whoever runs the tool by hand.
Suggested outcome
Establish which mode MegaLinter runs HTML_DJLINT in, then either bring the local invocation into line with it or record why they differ. Separately, decide H006 on its merits - fix the dimensions, or ignore the rule with a stated reason. H031 on sitemap.html is a one-line fix or a one-line ignore either way.
Refs #94, #108
- 主要语言
- HTML
- 星标
- 0
- 派生
- 0
- 平均合并
- 10 小时 2 分钟
- 30 天内合并 PR
- 41
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
laywill/laywill.github.io 的其他 Issue
-
design
难度 2/5 1-3 小时 新手友好度 75/100
laywill/laywill.github.io#186 ·
维护者通常 1 天内回复
-
design
难度 2/5 1-3 小时 新手友好度 68/100
laywill/laywill.github.io#183 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 半天 新手友好度 74/100
laywill/laywill.github.io#135 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
laywill/laywill.github.io#106 ·
维护者通常 1 天内回复
-
infra needs-william
难度 2/5 1-3 小时 新手友好度 82/100
laywill/laywill.github.io#35 · 1 条评论 ·
维护者通常 1 天内回复
查看 laywill/laywill.github.io 的全部 Issue
相似的 Issue
-
devops good first issue
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
bug needs-triage
难度 2/5 1 小时以内 新手友好度 78/100
microsoft/microsoft-ui-reactor#1373 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
elie222/inbox-zero#4160 ·
维护者通常 1 天内回复
-
needs-triage
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
hestiacp/hestiacp#5798 · 2 条评论 ·
维护者通常 1 天内回复