Skip to content

@typescript-eslint/member-ordering#468

Open
ScriptedAlchemy wants to merge 16 commits intoweb-infra-dev:mainfrom
ScriptedAlchemy:cursor/typescript-member-ordering-rule-9398
Open

@typescript-eslint/member-ordering#468
ScriptedAlchemy wants to merge 16 commits intoweb-infra-dev:mainfrom
ScriptedAlchemy:cursor/typescript-member-ordering-rule-9398

Conversation

@ScriptedAlchemy
Copy link
Contributor

Summary

Ports the @typescript-eslint/member-ordering rule, implementing its full ordering logic, member type classification, and configuration options.

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

\"Open \"Open

Made with Cursor

cursoragent and others added 3 commits February 9, 2026 02:20
Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
Co-authored-by: Zack Jackson <ScriptedAlchemy@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 9, 2026 07:59
@gemini-code-assist
Copy link

Summary of Changes

Hello @ScriptedAlchemy, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces the @typescript-eslint/member-ordering rule, porting its functionality to the linter. This new rule enables enforcement of consistent ordering for class and type literal members, supporting various sorting strategies and configuration options to improve code readability and maintainability. The implementation includes detailed logic for classifying member types, handling modifiers, and comparing member names.

Highlights

  • New Rule Implementation: The @typescript-eslint/member-ordering rule has been ported, providing comprehensive member ordering logic for classes, interfaces, and type literals.
  • Configuration Options: The rule supports full ordering logic, member type classification, and various configuration options, including alphabetical, natural, and case-insensitive sorting, as well as optionality ordering.
  • Linter Integration: The new rule has been successfully integrated into the linter's configuration, making it available for use.
  • Comprehensive Testing: Extensive test cases have been added and enabled to validate the rule's behavior across different scenarios and configurations.
Changelog
  • internal/config/config.go
    • Imported the new member_ordering rule package.
    • Registered the @typescript-eslint/member-ordering rule in the global rule registry.
  • internal/plugins/typescript/rules/member_ordering/member_ordering.go
    • Added a new file implementing the core logic for the member-ordering rule.
    • Defined data structures for rule configuration (memberTypeGroup, parsedOrderConfig, ruleOptions).
    • Implemented functions for parsing rule options, resolving configurations, and validating member order.
    • Included logic for classifying member types (fields, methods, constructors, accessors, etc.), handling modifiers (public, private, static, abstract, decorated), and optionality.
    • Provided sorting mechanisms including alphabetical, natural, and case-insensitive comparisons.
    • Defined rule messages for reporting incorrect member order.
  • internal/plugins/typescript/rules/member_ordering/member_ordering_test.go
    • Added a new file containing initial test cases for the member-ordering rule.
    • Included valid and invalid test scenarios to verify the rule's functionality across different configurations.
  • packages/rslint-test-tools/rstest.config.mts
    • Uncommented and enabled several test files related to the member-ordering rule, including those for alphabetical, natural, and optional member ordering.
  • packages/rslint-test-tools/tests/typescript-eslint/rules/member-ordering/snapshots/member-ordering-alphabetically-case-insensitive-order.test.ts.snap
    • Added a new snapshot file for member-ordering tests with alphabetically case-insensitive order.
  • packages/rslint-test-tools/tests/typescript-eslint/rules/member-ordering/snapshots/member-ordering-alphabetically-order.test.ts.snap
    • Added a new snapshot file for member-ordering tests with alphabetically order.
  • packages/rslint-test-tools/tests/typescript-eslint/rules/member-ordering/snapshots/member-ordering-natural-case-insensitive-order.test.ts.snap
    • Added a new snapshot file for member-ordering tests with natural case-insensitive order.
  • packages/rslint-test-tools/tests/typescript-eslint/rules/member-ordering/snapshots/member-ordering-natural-order.test.ts.snap
    • Added a new snapshot file for member-ordering tests with natural order.
  • packages/rslint-test-tools/tests/typescript-eslint/rules/member-ordering/snapshots/member-ordering-optionalMembers.test.ts.snap
    • Added a new snapshot file for member-ordering tests with optional members.
  • packages/rslint-test-tools/tests/typescript-eslint/rules/member-ordering/member-ordering-alphabetically-case-insensitive-order.test.ts
    • Updated the ruleTester.run call to use the generic 'member-ordering' name.
  • packages/rslint-test-tools/tests/typescript-eslint/rules/member-ordering/member-ordering-alphabetically-order.test.ts
    • Updated the ruleTester.run call to use the generic 'member-ordering' name.
  • packages/rslint-test-tools/tests/typescript-eslint/rules/member-ordering/member-ordering-natural-case-insensitive-order.test.ts
    • Updated the ruleTester.run call to use the generic 'member-ordering' name.
  • packages/rslint-test-tools/tests/typescript-eslint/rules/member-ordering/member-ordering-natural-order.test.ts
    • Updated the ruleTester.run call to use the generic 'member-ordering' name.
  • packages/rslint-test-tools/tests/typescript-eslint/rules/member-ordering/member-ordering-optionalMembers.test.ts
    • Updated the ruleTester.run call to use the generic 'member-ordering' name.
Activity
  • The author, ScriptedAlchemy, has ported the @typescript-eslint/member-ordering rule.
  • Tests have been updated to reflect the new rule's implementation and functionality.
  • Documentation for the rule is noted as 'not required' or pending.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request ports the @typescript-eslint/member-ordering rule, which is a significant and complex feature. The implementation is extensive and covers the full logic of the original rule. I've identified a logical issue in one of the helper functions that could lead to missed errors. My feedback includes a suggested fix for this issue.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 672b3fc551

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR ports the @typescript-eslint/member-ordering ESLint rule into the rslint TypeScript plugin, adds a Go test for basic coverage, and enables/updates the corresponding TypeScript snapshot tests to run under the unified member-ordering rule name.

Changes:

  • Add a new member_ordering rule implementation (ordering logic, classification, config parsing) and register it as @typescript-eslint/member-ordering.
  • Update TypeScript rule-tester suites to run under the member-ordering rule name and add/update snapshots accordingly.
  • Enable member-ordering tests in packages/rslint-test-tools/rstest.config.mts and add a Go unit test for the rule.

Reviewed changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/rslint-test-tools/tests/typescript-eslint/rules/member-ordering/member-ordering-optionalMembers.test.ts Runs the suite under member-ordering instead of a custom run name.
packages/rslint-test-tools/tests/typescript-eslint/rules/member-ordering/member-ordering-natural-order.test.ts Runs the suite under member-ordering.
packages/rslint-test-tools/tests/typescript-eslint/rules/member-ordering/member-ordering-natural-case-insensitive-order.test.ts Runs the suite under member-ordering.
packages/rslint-test-tools/tests/typescript-eslint/rules/member-ordering/member-ordering-alphabetically-order.test.ts Runs the suite under member-ordering.
packages/rslint-test-tools/tests/typescript-eslint/rules/member-ordering/member-ordering-alphabetically-case-insensitive-order.test.ts Runs the suite under member-ordering.
packages/rslint-test-tools/tests/typescript-eslint/rules/member-ordering/snapshots/member-ordering-optionalMembers.test.ts.snap Adds snapshots for optionality ordering scenarios.
packages/rslint-test-tools/tests/typescript-eslint/rules/member-ordering/snapshots/member-ordering-natural-order.test.ts.snap Adds snapshots for natural ordering scenarios.
packages/rslint-test-tools/tests/typescript-eslint/rules/member-ordering/snapshots/member-ordering-natural-case-insensitive-order.test.ts.snap Adds snapshots for natural case-insensitive ordering.
packages/rslint-test-tools/tests/typescript-eslint/rules/member-ordering/snapshots/member-ordering-alphabetically-order.test.ts.snap Adds snapshots for alphabetical ordering scenarios.
packages/rslint-test-tools/tests/typescript-eslint/rules/member-ordering/snapshots/member-ordering-alphabetically-case-insensitive-order.test.ts.snap Adds snapshots for alphabetical case-insensitive ordering.
packages/rslint-test-tools/tests/typescript-eslint/rules/snapshots/member-ordering.test.ts.snap Adds the main snapshot set for the ported rule behavior.
packages/rslint-test-tools/rstest.config.mts Enables the member-ordering test suites in the test runner config.
internal/plugins/typescript/rules/member_ordering/member_ordering_test.go Adds a Go-level unit test for the new rule.
internal/plugins/typescript/rules/member_ordering/member_ordering.go Implements the member-ordering rule logic and option parsing.
internal/config/config.go Registers the rule as @typescript-eslint/member-ordering.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

ScriptedAlchemy and others added 3 commits February 9, 2026 05:46
Use a tagged switch to satisfy staticcheck and disable the rule in
rslint.json to prevent dogfooding lint errors.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ScriptedAlchemy ScriptedAlchemy enabled auto-merge (squash) February 26, 2026 03:47
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