Skip to content

Commit daa1717

Browse files
committed
fix(remark): move HTML section linters and skip YAML frontmatter
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 ---
1 parent a1f8442 commit daa1717

File tree

3 files changed

+13
-2
lines changed
  • etc/remark/plugins
  • lib/node_modules/@stdlib/_tools/remark/plugins/remark-lint-expected-html-sections/lib

3 files changed

+13
-2
lines changed

etc/remark/plugins/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ plugins.push( require( './frontmatter' ) );
2626
plugins = plugins.concat( require( './lint' ) );
2727
plugins.push( require( './eslint' ) );
2828
plugins.push( require( './lint-equations' ) );
29-
plugins.push( require( './lint-expected-html-sections' ) );
30-
plugins.push( require( './lint-html-section-structure' ) );
3129
plugins.push( require( './validate-links' ) );
3230

3331

etc/remark/plugins/lint/index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1323,6 +1323,16 @@ plugins.push([
13231323
[ 'error', '-' ]
13241324
]);
13251325

1326+
/**
1327+
* Validate HTML section hierarchy in README files according to stdlib conventions.
1328+
*/
1329+
plugins.push( require( './../lint-expected-html-sections' ) );
1330+
1331+
/**
1332+
* Validate HTML section structure in README files.
1333+
*/
1334+
plugins.push( require( './../lint-html-section-structure' ) );
1335+
13261336

13271337
// EXPORTS //
13281338

lib/node_modules/@stdlib/_tools/remark/plugins/remark-lint-expected-html-sections/lib/linter.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ function getAnchorNode( tree ) {
4848

4949
for ( i = 0; i < tree.children.length; i++ ) {
5050
node = tree.children[ i ];
51+
if ( node.type === 'yaml' ) {
52+
continue;
53+
}
5154
if ( node.type === 'html' && RE_HTML_COMMENT.test( node.value ) ) {
5255
continue;
5356
}

0 commit comments

Comments
 (0)