Skip to content

build: restore example ESLint rule overrides - #16394

Merged
kgryte merged 1 commit into
developfrom
philipp/restore-eslint-example-overrides
Oct 31, 2026
Merged

kgryte merged 1 commit into
developfrom
philipp/restore-eslint-example-overrides

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Restores example linting behavior lost during the flat-config migration.

Description

What is the purpose of this pull request?

This pull request:

  • sets no-new-wrappers to warn for JavaScript examples.
  • disables stdlib/jsdoc-doctest, stdlib/vars-order, and stdlib/no-unnecessary-nested-functions for examples.
  • enables stdlib/doctest and stdlib/require-last-path-relative for examples.

This restores checks of inline expected values and the final relative import, while preserving the legacy example-specific relaxations. Example code continues to be evaluated by stdlib/doctest to validate inline expected values.

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 original severities for all six restored rules, including the nested-function exemption from the editor overrides.

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

  • Applied the settings in the existing flat-config example entry, making them available through both CLI linting and editor integration, including nested example paths.

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:

  • Confirmed the baseline silently accepts an incorrect inline expected value.
  • Verified all six severities for both example and nested example paths.
  • Verified inline doctests reject incorrect expected values and accept correct values.
  • Verified wrapper construction produces a warning and the final require must be relative.
  • Verified the variable-order and nested-function relaxations apply to examples, with source-file settings unchanged.
  • Linted eslint.config.js and representative examples from assert/is-function and array/fixed-endian-factory: zero errors; existing warnings on the config's path import and an unused disable directive in the is-function example.
  • 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:31
@Planeshifter
Planeshifter requested review from a team and kgryte October 31, 2026 02:31
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Oct 31, 2026
@kgryte
kgryte merged commit 2a29f85 into develop Oct 31, 2026
32 checks passed
@kgryte
kgryte deleted the philipp/restore-eslint-example-overrides branch October 31, 2026 02:47
@stdlib-bot stdlib-bot 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