refactor: assign rule object to rule variable - #15809
Merged
Merged
Conversation
…doctest` Removed the stray `// MAIN //` header preceding `function main`, so the rule's `create` function falls under the existing `// FUNCTIONS //` section and `// MAIN //` holds only the rule object (layout used by 121/125 = 96.8% of sibling rules). Comment-only change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HUvGDqRNYY3PQpcCrs5uBq
…es/jsdoc-ordered-list-marker-style` Moved `function main` under `// FUNCTIONS //`, declared `var rule;` under `// VARIABLES //`, assigned the rule object under `// MAIN //`, and exported `rule` (layout used by 121/125 = 96.8% of sibling rules). The exported rule object is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HUvGDqRNYY3PQpcCrs5uBq
…es/jsdoc-typedef-typos` Moved `function main` under `// FUNCTIONS //`, declared `var rule;` under `// VARIABLES //`, assigned the rule object under `// MAIN //`, and exported `rule` (layout used by 121/125 = 96.8% of sibling rules). The exported rule object is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HUvGDqRNYY3PQpcCrs5uBq
…es/require-last-path-relative` Moved `function main` under `// FUNCTIONS //`, declared `var rule;` under `// VARIABLES //`, assigned the rule object under `// MAIN //`, and exported `rule` (layout used by 121/125 = 96.8% of sibling rules). The exported rule object is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HUvGDqRNYY3PQpcCrs5uBq
kgryte
approved these changes
Oct 2, 2026
rule variable in _tools/eslint/rules/{jsdoc-ordered-list-marker-style,jsdoc-typedef-typos,require-last-path-relative}rule variable
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.
Description
This pull request:
lib/main.jsfiles in@stdlib/_tools/eslint/rulesin line with the section layout used by 121 of 125 sibling rules (96.8%). Each exported rule object is unchanged.The majority layout is:
var rule;under// VARIABLES //,function main( context )under// FUNCTIONS //,rule = { 'meta': ..., 'create': main };under// MAIN //, andmodule.exports = rule;under// EXPORTS //.@stdlib/_tools/eslint/rules/doctestRemoves a duplicate
// MAIN //header that came beforefunction main, somainfalls under the existing// FUNCTIONS //section. This is a comment-only change.@stdlib/_tools/eslint/rules/jsdoc-ordered-list-marker-styleMerges
function maininto the existing// FUNCTIONS //section, declaresvar rule;, moves the inlinemodule.exports = {...}torule = {...}under// MAIN //, and exportsrule.@stdlib/_tools/eslint/rules/jsdoc-typedef-typosRenames the
// MAIN //header abovefunction mainto// FUNCTIONS //(the file had no FUNCTIONS section), declaresvar rule;, and replaces the inline export withrule = {...}plusmodule.exports = rule;.@stdlib/_tools/eslint/rules/require-last-path-relativeAdds a
// VARIABLES //section withvar rule;, mergesfunction maininto// FUNCTIONS //, and replaces the inline export withrule = {...}plusmodule.exports = rule;.Related Issues
None.
Questions
No.
Other
Namespace summary.
_tools/eslint/ruleshas 125 member packages, none autogenerated. The run compared:package.jsonkeys, README sections, and test/benchmark/example file names.createsignature, return kind, validation prologue, error construction, JSDoc shape, and dependencies.metakeys andlib/main.jssection layout.Every feature had a clear majority (≥75%) except how
context.reportmessages are built (plain strings in 93/125 = 74.4%), which was excluded.Validation.
lib/main.jspassesnode --check, and its exportedmeta/createwere checked to be identical before and after.typeof rule === 'object'.Deliberately excluded.
meta.docs.descriptionforfirst-unit-testandjsdoc-first-heading-level(123/125 have none). Dropped because the fix changes the exported metadata string, which needs a human call."bin": {}in threepackage.jsonfiles.binis present in only about 9% ofpackage.jsonfiles stdlib-wide, so its absence is not treated as drift.Open draft #11928 also touches
doctest/lib/main.js(a regex at line 51) but does not overlap this change.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was written primarily by Claude Code as part of an automated cross-package drift-detection run.
🤖 Generated with Claude Code
https://claude.ai/code/session_01HUvGDqRNYY3PQpcCrs5uBq
Generated by Claude Code