-
-
Notifications
You must be signed in to change notification settings - Fork 0
Enable test for consistent-generic-constructors rule #155
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
Conversation
This commit uncomments the test file for the consistent-generic-constructors rule in rstest.config.mts. All tests pass successfully. The consistent-generic-constructors rule enforces consistent placement of type arguments in constructor calls: - 'type-annotation' style: const x: Foo<string> = new Foo() - 'constructor' style (default): const x = new Foo<string>() Test results: - All 75 test cases pass (50 valid, 25 invalid) - Go implementation already supports all features - Follows pattern from #154 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
🤖 This pull request has been linked to DevBird Task #1537 View the task details and manage the automated development workflow in DevBird. Learn more about DevBird here or the announcement blog post here. |
📋 DevBird Task PromptEnable the test for the ObjectiveUncomment the test file Documentation & Resources
Implementation Steps
Critical RequirementIf CI fails, implement consistent-generic-constructors from scratch:
Success Criteria
This comment was automatically added by DevBird. You can disable this feature in DevBird Settings. |
Pull Request Review - #155: Enable test for consistent-generic-constructors ruleSummaryThis PR enables the test suite for the Code Quality & Best Practices ✅Excellent adherence to repository conventions:
Implementation Review ✅I reviewed the underlying implementation at Strengths:
Test Coverage ✅Excellent test coverage in both test files:
Potential Issues & ConcernsMinor: No Autofix Implementation
|
## Summary - Uncommented the test file for consistent-indexed-object-style rule in `rstest.config.mts` - Follow-up to #155, which enabled the test for consistent-generic-constructors rule ## Context This PR enables the test suite for consistent-indexed-object-style rule, which enforces consistent usage of indexed object types in TypeScript. ## Changes ### Test Configuration (rstest.config.mts:40) - Uncommented the line enabling the consistent-indexed-object-style test file ### Implementation Status The Go implementation at `internal/plugins/typescript/rules/consistent_indexed_object_style/` already supports all required features: 1. **Default 'record' style**: Enforces use of `Record<K, V>` utility type - Example: `type Foo = Record<string, any>;` 2. **'index-signature' style option**: Enforces use of index signatures - Example: `type Foo = { [key: string]: any };` 3. **'mapped-type' style option**: Enforces use of mapped types - Example: `type Foo = { [K in string]: any };` 4. **Comprehensive coverage**: - Interface declarations with index signatures - Type literals with index signatures - Mapped types - Record type references - Circular reference detection to avoid false positives ## TypeScript-ESLint Reference The implementation follows the behavior of the TypeScript-ESLint consistent-indexed-object-style rule: https://typescript-eslint.io/rules/consistent-indexed-object-style/ ## Documentation References - TypeScript index signatures: https://www.typescriptlang.org/docs/handbook/2/objects.html#index-signatures - Record utility type: https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>
## Summary - Uncommented the test file for consistent-generic-constructors rule in `rstest.config.mts` - All tests now pass successfully ## Context This PR is a follow-up to #154, which enabled the test for class-methods-use-this rule. This PR enables the test suite for consistent-generic-constructors. ## Changes ### Test Configuration (rstest.config.mts:39) - Uncommented the line enabling the consistent-generic-constructors test file ### Implementation Status The Go implementation at `internal/plugins/typescript/rules/consistent_generic_constructors/` already supports all required features: 1. **Default 'constructor' style**: Enforces type arguments on constructor calls - Example: `const a = new Foo<string>();` 2. **'type-annotation' style option**: Enforces type arguments on type annotations - Example: `const a: Foo<string> = new Foo();` 3. **Comprehensive coverage**: - Variable declarations - Property declarations (including accessor properties) - Function/method parameters - Destructuring patterns - Default parameter values ## Test Results All tests pass successfully: - 50 valid test cases: ✓ - 25 invalid test cases: ✓ - Total: 75 test cases passed ## TypeScript-ESLint Reference The implementation follows the behavior of the TypeScript-ESLint consistent-generic-constructors rule: https://typescript-eslint.io/rules/consistent-generic-constructors/ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>
## Summary - Uncommented the test file for consistent-indexed-object-style rule in `rstest.config.mts` - Follow-up to #155, which enabled the test for consistent-generic-constructors rule ## Context This PR enables the test suite for consistent-indexed-object-style rule, which enforces consistent usage of indexed object types in TypeScript. ## Changes ### Test Configuration (rstest.config.mts:40) - Uncommented the line enabling the consistent-indexed-object-style test file ### Implementation Status The Go implementation at `internal/plugins/typescript/rules/consistent_indexed_object_style/` already supports all required features: 1. **Default 'record' style**: Enforces use of `Record<K, V>` utility type - Example: `type Foo = Record<string, any>;` 2. **'index-signature' style option**: Enforces use of index signatures - Example: `type Foo = { [key: string]: any };` 3. **'mapped-type' style option**: Enforces use of mapped types - Example: `type Foo = { [K in string]: any };` 4. **Comprehensive coverage**: - Interface declarations with index signatures - Type literals with index signatures - Mapped types - Record type references - Circular reference detection to avoid false positives ## TypeScript-ESLint Reference The implementation follows the behavior of the TypeScript-ESLint consistent-indexed-object-style rule: https://typescript-eslint.io/rules/consistent-indexed-object-style/ ## Documentation References - TypeScript index signatures: https://www.typescriptlang.org/docs/handbook/2/objects.html#index-signatures - Record utility type: https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>
## Summary - Uncommented the test file for consistent-generic-constructors rule in `rstest.config.mts` - All tests now pass successfully ## Context This PR is a follow-up to #154, which enabled the test for class-methods-use-this rule. This PR enables the test suite for consistent-generic-constructors. ## Changes ### Test Configuration (rstest.config.mts:39) - Uncommented the line enabling the consistent-generic-constructors test file ### Implementation Status The Go implementation at `internal/plugins/typescript/rules/consistent_generic_constructors/` already supports all required features: 1. **Default 'constructor' style**: Enforces type arguments on constructor calls - Example: `const a = new Foo<string>();` 2. **'type-annotation' style option**: Enforces type arguments on type annotations - Example: `const a: Foo<string> = new Foo();` 3. **Comprehensive coverage**: - Variable declarations - Property declarations (including accessor properties) - Function/method parameters - Destructuring patterns - Default parameter values ## Test Results All tests pass successfully: - 50 valid test cases: ✓ - 25 invalid test cases: ✓ - Total: 75 test cases passed ## TypeScript-ESLint Reference The implementation follows the behavior of the TypeScript-ESLint consistent-generic-constructors rule: https://typescript-eslint.io/rules/consistent-generic-constructors/ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>
## Summary - Uncommented the test file for consistent-indexed-object-style rule in `rstest.config.mts` - Follow-up to #155, which enabled the test for consistent-generic-constructors rule ## Context This PR enables the test suite for consistent-indexed-object-style rule, which enforces consistent usage of indexed object types in TypeScript. ## Changes ### Test Configuration (rstest.config.mts:40) - Uncommented the line enabling the consistent-indexed-object-style test file ### Implementation Status The Go implementation at `internal/plugins/typescript/rules/consistent_indexed_object_style/` already supports all required features: 1. **Default 'record' style**: Enforces use of `Record<K, V>` utility type - Example: `type Foo = Record<string, any>;` 2. **'index-signature' style option**: Enforces use of index signatures - Example: `type Foo = { [key: string]: any };` 3. **'mapped-type' style option**: Enforces use of mapped types - Example: `type Foo = { [K in string]: any };` 4. **Comprehensive coverage**: - Interface declarations with index signatures - Type literals with index signatures - Mapped types - Record type references - Circular reference detection to avoid false positives ## TypeScript-ESLint Reference The implementation follows the behavior of the TypeScript-ESLint consistent-indexed-object-style rule: https://typescript-eslint.io/rules/consistent-indexed-object-style/ ## Documentation References - TypeScript index signatures: https://www.typescriptlang.org/docs/handbook/2/objects.html#index-signatures - Record utility type: https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>
Summary
rstest.config.mtsContext
This PR is a follow-up to #154, which enabled the test for class-methods-use-this rule. This PR enables the test suite for consistent-generic-constructors.
Changes
Test Configuration (rstest.config.mts:39)
Implementation Status
The Go implementation at
internal/plugins/typescript/rules/consistent_generic_constructors/already supports all required features:Default 'constructor' style: Enforces type arguments on constructor calls
const a = new Foo<string>();'type-annotation' style option: Enforces type arguments on type annotations
const a: Foo<string> = new Foo();Comprehensive coverage:
Test Results
All tests pass successfully:
TypeScript-ESLint Reference
The implementation follows the behavior of the TypeScript-ESLint consistent-generic-constructors rule:
https://typescript-eslint.io/rules/consistent-generic-constructors/
🤖 Generated with Claude Code