Skip to content

fix(remark): move HTML section linters and skip YAML frontmatter#11042

Open
batpigandme wants to merge 1 commit intostdlib-js:developfrom
batpigandme:fix-lint-expected-html-sections-disable
Open

fix(remark): move HTML section linters and skip YAML frontmatter#11042
batpigandme wants to merge 1 commit intostdlib-js:developfrom
batpigandme:fix-lint-expected-html-sections-disable

Conversation

@batpigandme
Copy link
Member

@batpigandme batpigandme commented Mar 19, 2026

Move HTML section linting plugins to the central linting plugin list to ensure consistent configuration and update the expected sections linter to ignore YAML frontmatter when searching for anchor nodes so that <-- lint disable ... --> comments work properly with remark-lint and unified-message-control.

Assisted-by: Claude-Opus-4-6


type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes. report:

  • task: lint_filenames status: passed
  • task: lint_editorconfig status: passed
  • task: lint_markdown status: na
  • task: lint_package_json status: na
  • task: lint_repl_help status: na
  • task: lint_javascript_src status: passed
  • task: lint_javascript_cli status: na
  • task: lint_javascript_examples status: na
  • task: lint_javascript_tests status: na
  • task: lint_javascript_benchmarks status: na
  • task: lint_python status: na
  • task: lint_r status: na
  • task: lint_c_src status: na
  • task: lint_c_examples status: na
  • task: lint_c_benchmarks status: na
  • task: lint_c_tests_fixtures status: na
  • task: lint_shell status: na
  • task: lint_typescript_declarations status: passed
  • task: lint_typescript_tests status: na
  • task: lint_license_headers status: passed

Description

What is the purpose of this pull request?

This pull request:

Extends #11009 to make the lint disabling less brittle, and compatible with the use of YAML frontmatter (discovered that it wasn't when trying to use a GitHub Agentic Workflow, the structure of which is YAML and Markdown).

AI Description

  1. etc/remark/plugins/lint/index.js — Moved lint-expected-html-sections and lint-html-section-structure into the lint plugin batch so their transforms run before remark-message-control's one-shot message filter. This is the core fix that makes <!-- lint disable expected-html-sections --> work.
  2. lib/node_modules/@stdlib/_tools/remark/plugins/remark-lint-expected-html-sections/lib/linter.js — Updated getAnchorNode to skip yaml frontmatter nodes, so messages in files with YAML frontmatter aren't anchored before disable comments.

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

No.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".

Used Claude Opus 4.6 to troubleshoot failing disabling of linter. Full session here: https://app.warp.dev/conversation/b9bc28f8-92dc-45a6-b94f-825c576ed398


@stdlib-js/reviewers

Move HTML section linting plugins to the central linting plugin list to ensure consistent configuration and update the expected sections linter to ignore YAML frontmatter when searching for anchor nodes.

Assisted-by: Claude-Opus-4-6

---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
  - task: lint_filenames
    status: passed
  - task: lint_editorconfig
    status: passed
  - task: lint_markdown
    status: na
  - task: lint_package_json
    status: na
  - task: lint_repl_help
    status: na
  - task: lint_javascript_src
    status: passed
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: na
  - task: lint_javascript_benchmarks
    status: na
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: na
  - task: lint_c_examples
    status: na
  - task: lint_c_benchmarks
    status: na
  - task: lint_c_tests_fixtures
    status: na
  - task: lint_shell
    status: na
  - task: lint_typescript_declarations
    status: passed
  - task: lint_typescript_tests
    status: na
  - task: lint_license_headers
    status: passed
---
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review A pull request which needs code review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants