build: migrate Markdown code-block linting to ESLint flat config - #14668
Open
Planeshifter wants to merge 5 commits into
Open
build: migrate Markdown code-block linting to ESLint flat config#14668Planeshifter wants to merge 5 commits into
Planeshifter wants to merge 5 commits into
Conversation
Ref: stdlib-js/metr-issue-tracker#1223 --- 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_pkg_readmes status: na - task: lint_markdown_docs status: na - 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 ---
Executing the example would run the linter within the linter and deadlock, which caused the "Run changed examples" CI job to time out. Ref: stdlib-js/metr-issue-tracker#1223 --- 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_pkg_readmes status: passed - task: lint_markdown_docs status: na - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - 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 ---
Executing the example via the `stdlib/doctest` rule would run the linter within the linter and deadlock, which caused the "Lint Changed Files" CI job to time out. Ref: stdlib-js/metr-issue-tracker#1223 --- 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_pkg_readmes status: na - task: lint_markdown_docs status: na - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - 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 ---
Now that Markdown code blocks are linted using the path of the containing file, rules which special-cased anonymous (`<text>`) input to tolerate not-yet-implemented packages (readme-driven development) must apply the same leniency to Markdown file paths. Also share the host realm's error constructors with the doctest sandbox so that `instanceof` checks on host-created errors succeed. Ref: stdlib-js/metr-issue-tracker#1223 Co-authored-by: Athan Reines <kgryte@gmail.com> --- 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_pkg_readmes status: na - task: lint_markdown_docs status: na - 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 ---
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves stdlib-js/metr-issue-tracker#1223.
Description
This pull request:
FlatESLint) and v9 (defaultESLintclass); the removeduseEslintrcoption is no longer used.etc/eslint/eslint.flat.config.markdown.js, which extends the root flat config with the Markdown rule overrides from.eslintrc.markdown.js(the legacy file is left in place until nothing depends on it).lintText()'sfilePath), with companion updates so readme-driven development leniency and doctest evaluation continue to work under.mdfile paths.stdlib/doctestrule or the example runner) so it is neither executed nor doctested; both remain runnable standalone.Verified byte-identical lint output between the legacy and new configurations on fixtures with deliberate errors (including doctests and inline
<!-- eslint ... -->comments), and that errors in READMEs underlib/node_modulesare still detected (flat-config ESLint ignoresnode_modulesby default; an unignore pattern in the config handles this). Implementation notes and pitfalls (e.g.,ignore: falsedisabling unignore patterns) are documented in the config and commit messages.Related Issues
This pull request has the following related issues:
Questions
No.
Other
#10972 has been rebased on top of this PR and should land after it.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was written primarily by Claude Code, including root-cause investigation, implementation, and verification, under human direction and review.
@stdlib-js/reviewers