Skip to content

build: restore doctest exemption for ESLint rule definitions - #16396

Merged
kgryte merged 1 commit into
developfrom
philipp/restore-eslint-rule-doc-exemption
Oct 31, 2026
Merged

kgryte merged 1 commit into
developfrom
philipp/restore-eslint-rule-doc-exemption

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Restores the JSDoc doctest exemption for ESLint rule-definition files.

Description

What is the purpose of this pull request?

This pull request:

These files document lint rules using illustrative "Bad" and "Good" examples. Treating intentionally incorrect expected values in that documentation as executable doctests produces misleading lint failures. The override preserves the original path scope and leaves all other lint rules enabled.

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

Reference Packages

Did the content of this pull request follow one or more existing packages? Answering is optional.

This pull request followed these packages:

What carried over from the reference(s)?

  • The exact etc/eslint/rules/*.js file pattern and stdlib/jsdoc-doctest: 'off' override.

What differed, or what did you have to work out yourself?

  • Added the override as an entry in eslint.config.js and verified that it changes only the intended rule and file scope.

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.

Validation:

  • Reproduced a doctest failure for an illustrative incorrect expected value under the rule-definition path before applying the override.
  • Verified the same documentation is exempt afterward while ordinary source-file doctests still report the error.
  • Compared effective rule configurations: only stdlib/jsdoc-doctest changes for rule-definition files.
  • Confirmed nested directories outside the original file pattern retain doctest checking.
  • Confirmed no-undef still detects undefined names in rule-definition files.
  • Linted eslint.config.js and all 11 JavaScript files under etc/eslint/rules/: zero errors and nine warnings in existing code.
  • git diff --check, normal pre-commit checks, and the pre-push dependency license check passed.

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.".

This PR was written primarily by OpenAI Codex under human direction, including investigation, implementation, validation, and the PR description.


@stdlib-js/reviewers

---
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
---
@Planeshifter
Planeshifter marked this pull request as ready for review October 31, 2026 02:44
@Planeshifter
Planeshifter requested review from a team and kgryte October 31, 2026 02:44
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Oct 31, 2026
@kgryte
kgryte merged commit a3a6105 into develop Oct 31, 2026
32 checks passed
@kgryte
kgryte deleted the philipp/restore-eslint-rule-doc-exemption branch October 31, 2026 02:57
@kgryte kgryte removed the Needs Review A pull request which needs code review. label Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants