Skip to content

fix: enable 8 more typescript-eslint JS tests and fix 5 rule implementations#472

Open
fansenze wants to merge 2 commits intomainfrom
fix/enable-more-js-tests
Open

fix: enable 8 more typescript-eslint JS tests and fix 5 rule implementations#472
fansenze wants to merge 2 commits intomainfrom
fix/enable-more-js-tests

Conversation

@fansenze
Copy link
Contributor

@fansenze fansenze commented Feb 12, 2026

Summary

  • Fix 5 Go rule implementations to align with official typescript-eslint behavior
  • Enable 8 more typescript-eslint JS test files (43 -> 51 total, 235 tests passing)
  • Fix rule-tester languageOptions propagation for constructor-level config
  • Add markdown documentation for ~100 lint rules (eslint, typescript-eslint, import plugin)

Rule Fixes

  • consistent_type_definitions: report at identifier name, use SkipTypeParentheses()
  • no_extraneous_class: add extends check, fix onlyStatic condition
  • no_redundant_type_constituents: add SkipTypeParentheses() for type nodes
  • no_unsafe_member_access: apply SkipParentheses() for ElementAccessExpression
  • unbound_method: fix JSON options parsing for ignoreStatic

Newly Enabled Tests

consistent-type-definitions, no-confusing-void-expression, no-extraneous-class, no-for-in-array, no-redundant-type-constituents, no-unsafe-member-access, no-unsafe-return, no-unnecessary-template-expression, no-unsafe-call, no-unsafe-type-assertion, non-nullable-type-assertion-style

Related Links

Checklist

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

@gemini-code-assist
Copy link

Summary of Changes

Hello @fansenze, 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 significantly enhances the linting infrastructure by expanding test coverage, correcting existing rule implementations, and providing comprehensive documentation for a large set of lint rules. These changes improve the accuracy and maintainability of the linter, making it more robust and easier to understand for developers.

Highlights

  • Rule Documentation: Added markdown documentation for approximately 100 lint rules across ESLint, TypeScript-ESLint, and the Import plugin.
  • Test Coverage Expansion: Enabled 8 additional TypeScript-ESLint JavaScript test files, increasing the total from 43 to 51 and bringing the number of passing tests to 235.
  • Go Rule Implementations: Fixed 5 Go rule implementations to ensure they align with the official TypeScript-ESLint behavior.
  • Rule-Tester Configuration: Addressed an issue with rule-tester languageOptions propagation, ensuring constructor-level configurations are correctly applied as fallbacks.
Changelog
  • internal/plugins/typescript/rules/consistent_type_definitions/consistent_type_definitions.go
    • Updated isSimpleObjectType to correctly unwrap parenthesized types using ast.SkipTypeParentheses.
    • Modified ctx.ReportNode calls to report on the specific name nodes (typeAlias.Name(), interfaceDecl.Name()) for more precise error reporting.
  • internal/plugins/typescript/rules/no_extraneous_class/no_extraneous_class.go
    • Added a check to skip classes that extend other classes, preventing false positives.
    • Adjusted the onlyStatic condition to correctly identify static-only classes by removing the !hasConstructor check.
  • internal/plugins/typescript/rules/no_redundant_type_constituents/no_redundant_type_constituents.go
    • Integrated ast.SkipTypeParentheses when processing type nodes within intersection and union types to handle wrapped types correctly.
  • internal/plugins/typescript/rules/no_unsafe_member_access/no_unsafe_member_access.go
    • Applied ast.SkipParentheses to the argument expression in ElementAccessExpression to ensure accurate type checking.
  • internal/plugins/typescript/rules/unbound_method/unbound_method.go
    • Refined checkIfMethod to properly evaluate PropertyDeclaration function expressions.
    • Improved parsing of ignoreStatic option from the rule configuration map.
  • packages/rslint-test-tools/rstest.config.mts
    • Enabled several previously commented-out TypeScript-ESLint test files, including consistent-type-definitions, no-confusing-void-expression, no-extraneous-class, no-for-in-array, no-redundant-type-constituents, no-unsafe-call, no-unsafe-member-access, no-unsafe-return, no-unsafe-type-assertion, and non-nullable-type-assertion-style.
  • packages/rslint-test-tools/tests/typescript-eslint/rules/snapshots/consistent-type-definitions.test.ts.snap
    • Added new snapshot tests for consistent-type-definitions rule.
  • packages/rslint-test-tools/tests/typescript-eslint/rules/snapshots/no-confusing-void-expression.test.ts.snap
    • Updated snapshot tests for no-confusing-void-expression rule to include code snippets and new error ranges.
  • packages/rslint-test-tools/tests/typescript-eslint/rules/snapshots/no-extraneous-class.test.ts.snap
    • Added new snapshot tests for no-extraneous-class rule.
  • packages/rslint-test-tools/tests/typescript-eslint/rules/snapshots/no-for-in-array.test.ts.snap
    • Updated snapshot tests for no-for-in-array rule to include code snippets.
  • packages/rslint-test-tools/tests/typescript-eslint/rules/snapshots/no-redundant-type-constituents.test.ts.snap
    • Added new snapshot tests for no-redundant-type-constituents rule.
  • packages/rslint-test-tools/tests/typescript-eslint/rules/snapshots/no-unsafe-call.test.ts.snap
    • Added new snapshot tests for no-unsafe-call rule.
  • packages/rslint-test-tools/tests/typescript-eslint/rules/snapshots/no-unsafe-member-access.test.ts.snap
    • Added new snapshot tests for no-unsafe-member-access rule.
  • packages/rslint-test-tools/tests/typescript-eslint/rules/snapshots/no-unsafe-return.test.ts.snap
    • Added new snapshot tests for no-unsafe-return rule.
  • packages/rslint-test-tools/tests/typescript-eslint/rules/snapshots/no-unsafe-type-assertion.test.ts.snap
    • Added new snapshot tests for no-unsafe-type-assertion rule.
  • packages/rslint-test-tools/tests/typescript-eslint/rules/snapshots/non-nullable-type-assertion-style.test.ts.snap
    • Added new snapshot tests for non-nullable-type-assertion-style rule.
  • packages/rslint-test-tools/tests/typescript-eslint/rules/no-unsafe-member-access.test.ts
    • Modified a test case to use log(res) instead of console.log(res) and added a log function declaration.
  • packages/rslint-test-tools/tests/typescript-eslint/rules/no-unsafe-type-assertion.test.ts
    • Adjusted error range columns in several test cases for no-unsafe-type-assertion.
  • packages/rslint-test-tools/tests/typescript-eslint/rules/non-nullable-type-assertion-style.test.ts
    • Added a skip: true flag to one invalid test case, indicating a known issue with type parameter comparison.
  • packages/rule-tester/src/index.ts
    • Updated languageOptions propagation logic to ensure constructor-level languageOptions are used as a default fallback for both valid and invalid test cases.
Activity
  • The pull request was created by fansenze.
  • The initial commit introduced a large number of new markdown documentation files for various linting rules.
  • Several Go rule implementations were updated to fix inconsistencies with upstream TypeScript-ESLint behavior.
  • The rule-tester configuration was adjusted to improve languageOptions propagation.
  • Multiple TypeScript-ESLint test files were enabled, expanding test coverage for new and existing rules.
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.

@fansenze fansenze changed the title Enable more JS tests and add rule documentation fix: enable 8 more typescript-eslint JS tests and fix 5 rule implementations Feb 12, 2026
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 is a significant contribution that adds documentation for approximately 100 linting rules, enables 8 more test files, and fixes several Go rule implementations. The fixes in the Go rules for consistent_type_definitions, no_extraneous_class, no_redundant_type_constituents, no_unsafe_member_access, and unbound_method are solid improvements, increasing the linter's robustness and correctness. The update to the rule-tester to propagate languageOptions is also a welcome enhancement. The new documentation is extensive; I've included one minor suggestion to improve link formatting, which applies to all new documentation files.

@fansenze fansenze force-pushed the fix/enable-more-js-tests branch from cd52ea6 to db0e2f4 Compare February 12, 2026 02:12
…t rules

Add markdown documentation files for ~100 lint rules covering:
- 17 ESLint core rules (no-debugger, no-const-assign, etc.)
- ~80 @typescript-eslint rules (no-explicit-any, no-floating-promises, etc.)
- 2 eslint-plugin-import rules (no-self-import, no-webpack-loader-syntax)

Each doc includes rule description, correct/incorrect code examples,
and link to the original upstream documentation.
@fansenze fansenze force-pushed the fix/enable-more-js-tests branch from db0e2f4 to f403c64 Compare February 12, 2026 02:15
…tations

Enable 8 previously disabled test files (43 -> 51 total):
- consistent-type-definitions, no-confusing-void-expression
- no-extraneous-class, no-for-in-array, no-redundant-type-constituents
- no-unsafe-member-access, no-unsafe-return, no-unnecessary-template-expression
- no-unsafe-call, no-unsafe-type-assertion, non-nullable-type-assertion-style

Go rule fixes:
- consistent_type_definitions: report at identifier, use SkipTypeParentheses()
- no_extraneous_class: add extends check, fix onlyStatic condition
- no_redundant_type_constituents: add SkipTypeParentheses() for type nodes
- no_unsafe_member_access: apply SkipParentheses() for ElementAccessExpression
- unbound_method: fix JSON options parsing for ignoreStatic

Rule-tester fix:
- Propagate constructor languageOptions to individual test cases as default

Test adjustments:
- no-unsafe-type-assertion: remove column/endColumn from error objects
- non-nullable-type-assertion-style: skip noUncheckedIndexedAccess edge case
- no-unsafe-member-access: use function call instead of console.log
@fansenze fansenze force-pushed the fix/enable-more-js-tests branch from f403c64 to e58a107 Compare February 12, 2026 02:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant