Skip to content

feat: add adjacent-overload-signatures rule #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

ScriptedAlchemy
Copy link
Contributor

Summary

Add the adjacent-overload-signatures TypeScript ESLint rule to RSLint.

  • ✅ Go implementation of the adjacent-overload-signatures rule
  • ✅ Comprehensive test suite with 33 valid and 34 invalid test cases
  • ✅ Rule registration with both @typescript-eslint/adjacent-overload-signatures and adjacent-overload-signatures names
  • ✅ All tests passing

Test plan

  • Go tests pass: go test ./internal/rules/adjacent_overload_signatures/... -v
  • Rule properly registered in config.go
  • Enforces that function/method overload signatures appear adjacent to each other

This rule helps maintain clean and readable code by ensuring function/method overloads are grouped together rather than scattered throughout the codebase.

🤖 Generated with Claude Code

ScriptedAlchemy and others added 8 commits July 28, 2025 19:38
Add the adjacent-overload-signatures TypeScript ESLint rule to RSLint:

- Add Go implementation of adjacent-overload-signatures rule
- Include comprehensive test suite with valid and invalid cases
- Register rule with both @typescript-eslint/adjacent-overload-signatures and adjacent-overload-signatures names
- Enforces that overload signatures appear adjacent to each other

The rule helps maintain clean and readable code by ensuring function/method overloads are grouped together rather than scattered throughout the codebase.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Downloaded comprehensive test suite from typescript-eslint
- Updated imports to use RSLint test framework
- Preserves all original test cases for compatibility verification

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Convert test cases from object format to string format
- Remove languageOptions that are TypeScript ESLint specific
- Align with RSLint test framework expectations

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Fixed index tracking logic in checkBodyForOverloadMethods
- The rule was incorrectly tracking method indices across all members
- Now properly tracks the last method key and index separately
- This fixes the issue where non-adjacent overloads weren't being detected

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Remove debug_main.go test program
- Remove test-file.ts and test-adjacent.ts test files
- Remove test-rslint.json and rslint.jsonc debug configs
- Remove empty snapshot file that was generated during debugging

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Reverted language change in shared TypeScript ESLint test config
- This file is used by all TypeScript ESLint tests, not just adjacent-overload-signatures
- The change could have unintended effects on other tests

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Add adjacent-overload-signatures import and rule to API handler
- Update test messageId expectations to match camelCase rule name conversion
- Generate snapshots for all test cases
- All tests now passing

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
The rule count increased from 40 to 41 after adding adjacent-overload-signatures rule

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
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.

1 participant