-
-
Notifications
You must be signed in to change notification settings - Fork 813
build: add remark plugin for validating HTML section structure #6133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
--- 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: passed - task: lint_package_json status: passed - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: passed - 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
/stdlib update-copyright-years |
lib/node_modules/@stdlib/_tools/remark/plugins/remark-lint-html-section-structure/lib/main.js
Outdated
Show resolved
Hide resolved
--- 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: passed - 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
lib/node_modules/@stdlib/_tools/remark/plugins/remark-lint-html-section-structure/lib/main.js
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/_tools/remark/plugins/remark-lint-html-section-structure/lib/main.js
Show resolved
Hide resolved
lib/node_modules/@stdlib/_tools/remark/plugins/remark-lint-html-section-structure/lib/main.js
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/_tools/remark/plugins/remark-lint-html-section-structure/lib/main.js
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/_tools/remark/plugins/remark-lint-html-section-structure/lib/main.js
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/_tools/remark/plugins/remark-lint-html-section-structure/lib/main.js
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/_tools/remark/plugins/remark-lint-html-section-structure/lib/main.js
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/_tools/remark/plugins/remark-lint-html-section-structure/lib/main.js
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/_tools/remark/plugins/remark-lint-html-section-structure/lib/main.js
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/_tools/remark/plugins/remark-lint-html-section-structure/lib/main.js
Outdated
Show resolved
Hide resolved
lib/node_modules/@stdlib/_tools/remark/plugins/remark-lint-html-section-structure/lib/main.js
Outdated
Show resolved
Hide resolved
Signed-off-by: Athan <kgryte@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than questions around the use of exec
, this is shaping up.
--- 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: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
if ( !hasValidWhitespace( node, nextNode ) ) { | ||
msg = 'Missing proper empty line after closing section tag. There should be an empty line between </section> and the closing comment.'; | ||
errCode = 'missing-empty-line-after-section'; | ||
reportErr( file, node, msg, errCode ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Planeshifter Just checking, but for a number of these reportErr
statements, we don't early return, but instead fall through to subsequent logic. Are these fall-throughs intentional? I'd want to avoid a scenario where lint errors pile up and it becomes confusing for devs to understand what the actual issue is which is triggering lint failures.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we shouldn't be early returning, it may be good to add a comment in each circumstance indicating that fall-through is intentional.
This pull request:
README.md
files is accurate.Related Issues
This pull request:
<section>
tag has a matching closing tag metr-issue-tracker#49 by resolving 1) and 2).Questions
No.
Other
No.
Checklist
@stdlib-js/reviewers