Skip to content

chore: clean-up - #15506

Merged
kgryte merged 4 commits into
developfrom
philipp/drift-tools-eslint-rules-2026-09-24
Sep 24, 2026
Merged

kgryte merged 4 commits into
developfrom
philipp/drift-tools-eslint-rules-2026-09-24

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Description

What is the purpose of this pull request?

This pull request:

  • Corrects source-layout deviations in four @stdlib/_tools/eslint/rules packages so that their lib/ files follow the section-header and naming conventions used by the rest of the namespace. All changes are comment-only or local-identifier renames; no rule behavior, public signature, or test expectation changes.

Namespace summary

  • Namespace: @stdlib/_tools/eslint/rules
  • Members analyzed: 125 (no autogenerated members; the only Do not manually edit markers are the standard auto-populated README See Also comment)
  • Majority threshold: 94/125 = 75.2%
  • Features with a clear majority (>=75%): file tree, package.json top-level keys, README section list and order, lib/main.js section-header sequence, lib/index.js section-header sequence and @module block placement, rule-factory naming, rule-factory JSDoc tag set, rule object top-level keys, meta.docs keys, meta.type presence
  • Features without a clear majority (excluded from analysis): meta.fixable (72.8% absent), meta.schema length (72.0% zero-length), lib/ dependency set (no dependency reached 75%; highest was @stdlib/assert/is-object at 58.4%), package.json scripts keys and stdlib keys (uniformly empty/absent, no signal)

_tools/eslint/rules/jsdoc-doctest

Removed the duplicate // MAIN // header in lib/main.js: the rule factory now stays under // FUNCTIONS //, and // MAIN // introduces only the exported rule object, matching the namespace's dominant pattern (118/125 packages, 94.4%). Comment-only change; the rule object and its meta are untouched.

_tools/eslint/rules/jsdoc-example-require-spacing

lib/main.js had a duplicate // MAIN // header wrapping the rule factory; removed it and folded the factory back into // FUNCTIONS //, matching 118/125 packages (94.4%). lib/index.js deviated on three conventions at once — @module block placed below // MODULES //, an extraneous // MAIN // header, and the local binding named rule instead of main — each convention holding in 124/125 packages (99.2%), with this the sole outlier on all three. Corrected all three; module.exports still resolves to the same rule object, no behavior change.

_tools/eslint/rules/jsdoc-no-space-aligned-asterisks

In lib/main.js, the first // MAIN // header — over the rule factory — is retitled // FUNCTIONS //; // MAIN // now applies solely to the exported rule object, matching the pattern used in 118 of 125 packages (94.4%). // FUNCTIONS // is an accepted header per the repository's own stdlib/section-headers rule. Comment-only change; the rule object and its meta are untouched.

_tools/eslint/rules/require-spaces

In lib/main.js, the function assigned to the rule's create property is renamed from create to main. This brings the package in line with 124 of 125 packages in the namespace (99.2% conformance); require-spaces was the sole outlier. Nothing depends on the function's name: tests and examples consume only the exported rule object, and ESLint's plugin registry resolves rules by string id.

Related Issues

Does this pull request have any related issues?

No.

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

Checked:

  • Structural extraction across all 125 members: file trees, package.json key sets, README section lists and order, and test/, benchmark/, examples/ file naming.
  • Semantic extraction: rule object and meta shape recovered by loading every package; section headers, rule-factory JSDoc tag sets, lib/index.js layout, and require() dependency sets extracted from source across all 125 members. Per-package extraction agents were run over 40 of 125 packages (every candidate outlier plus a random control set) and agreed with the deterministic extraction on every field of every package.
  • Three-agent review of each candidate correction: semantic review (is the deviation intentional?), cross-reference review (do tests, fixtures, examples, the plugin registry, or etc/eslint/rules/stdlib.js depend on the deviating behavior?), and structural review (is the majority pattern actually the right thing to apply?).
  • Post-change: node --check on all five modified files; every modified package still loads and exports {meta, create} with an unchanged meta object.

Deliberately excluded:

  • meta.type (20 packages). The majority pattern is the absence of meta.type (105/125, 84.0%), but all 20 deviating packages use valid ESLint core enum values. Removing correct metadata to match a majority would be a regression.
  • @private on the rule factory (2 packages). Same shape: the majority pattern is absence (123/125, 98.4%), so the "correction" would be deleting documentation. Not applied.
  • test/fixtures/unvalidated.js (6 packages). Present in 119/125 (95.2%), but none of the six packages' test/test.js references such a fixture. Adding the file alone would create an orphan; the real gap is a missing third test case whose applicability varies per rule. Out of scope — needs human judgment.
  • package.json bin key (3 packages). Present in 122/125 (97.6%) within the namespace, but in only 9.3% of stdlib packages overall — an internal _tools convention rather than a stdlib-wide one, so its absence is not treated as drift.
  • Inline rule-object export shape (3 packages). jsdoc-ordered-list-marker-style, jsdoc-typedef-typos, and require-last-path-relative export an inline object literal rather than assigning to a rule variable. Converting them is a multi-line restructure rather than a mechanical correction, so it was left out of this pass.
  • _tools/eslint/rules/doctest. Has the same duplicate-// MAIN // shape as jsdoc-doctest, but doctest/lib/main.js is already modified by open PR fix: prevent doctest false-positive on function declarations; remove stale ESLint disable #11928, so it was left alone to avoid a conflicting edit.
  • require-spaces README <section class="related">. Missing where 124/125 packages have it, but that section is auto-populated by the package generator and is not hand-edited.

tape and eslint are not installed in the environment this branch was prepared in, so the packages' own test suites were not executed locally; CI covers them.

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 authored by Claude Code. It ran an automated cross-package drift analysis over the _tools/eslint/rules namespace, extracted structural and semantic features from all 125 member packages, computed per-feature majority patterns at a 75% threshold, and applied the resulting corrections. Candidate corrections were filtered through automated review passes before being applied, and the excluded findings are listed under "Other" above. Reviewers should verify the section-header conventions and the require-spaces factory rename against their own expectations for the namespace.


@stdlib-js/reviewers


Generated by Claude Code

…ctest`

The rule factory sat under a second `// MAIN //` header, leaving the file
with two MAIN sections. Removed the stray header so the factory stays in
the already-open FUNCTIONS section and `// MAIN //` introduces only the
rule object, matching 118 of 125 siblings (94.4%).

Comment-only change; the exported rule object and its `meta` are
unchanged.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J5voNUyxQDwCnzfVNhTqxA
…require-spacing`

Corrected two layout deviations:

- `lib/main.js`: the rule factory sat under a second `// MAIN //` header,
  leaving two MAIN sections. Removed the stray header so the factory stays
  in the FUNCTIONS section (94.4% of siblings).
- `lib/index.js`: hoisted the `@module` documentation block above
  `// MODULES //`, removed the `// MAIN //` header, and renamed the local
  binding from `rule` to `main`. Each of these three matched 124 of 125
  siblings (99.2%); this was the only package deviating on any of them.

No behavior change; `module.exports` resolves to the same rule object.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J5voNUyxQDwCnzfVNhTqxA
…ce-aligned-asterisks`

The rule factory sat under a `// MAIN //` header and the rule object under
a second one, leaving the file with two MAIN sections and no FUNCTIONS
section. Retitled the first header to `// FUNCTIONS //`, matching 118 of
125 siblings (94.4%).

`// FUNCTIONS //` is an accepted header in the repository's own
`stdlib/section-headers` rule. Comment-only change; the exported rule
object and its `meta` are unchanged.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J5voNUyxQDwCnzfVNhTqxA
…-spaces`

The function assigned to the rule's `create` property was named `create`.
Renamed it to `main`, matching 124 of 125 siblings (99.2%); this was the
only package using a different name.

Nothing reads the function's `name` property: tests and examples consume
only the exported rule object, and the ESLint plugin registry addresses
rules by string id.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J5voNUyxQDwCnzfVNhTqxA
@stdlib-bot stdlib-bot added the Tools Issue or pull request related to project tooling. label Sep 24, 2026
@kgryte
kgryte marked this pull request as ready for review September 24, 2026 23:53
@kgryte
kgryte requested a review from a team September 24, 2026 23:53
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Sep 24, 2026
@kgryte kgryte changed the title refactor: correct lib section headers and factory naming in four _tools/eslint/rules packages chore: clean-up Sep 24, 2026
@kgryte
kgryte merged commit a74c9ae into develop Sep 24, 2026
47 checks passed
@kgryte
kgryte deleted the philipp/drift-tools-eslint-rules-2026-09-24 branch September 24, 2026 23:55
@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Sep 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Tools Issue or pull request related to project tooling.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants