Skip to content

feat: port rule no-caller#528

Merged
fansenze merged 1 commit intomainfrom
feat/port-rule-no-caller-20260317
Apr 3, 2026
Merged

feat: port rule no-caller#528
fansenze merged 1 commit intomainfrom
feat/port-rule-no-caller-20260317

Conversation

@fansenze
Copy link
Copy Markdown
Contributor

@fansenze fansenze commented Mar 17, 2026

Summary

Port the no-caller rule from ESLint to rslint.

Disallow the use of arguments.caller or arguments.callee

Related Links

Checklist

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

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 a new static analysis rule to the linter, aimed at improving code quality and performance by preventing the use of deprecated and problematic arguments.caller and arguments.callee properties. The addition ensures that code adheres to modern JavaScript best practices, avoiding constructs that hinder optimizations and are forbidden in strict mode.

Highlights

  • New Linting Rule: A new linting rule, no-caller, has been ported from ESLint to rslint. This rule disallows the use of arguments.caller and arguments.callee.
  • Rule Implementation: The no-caller rule identifies and reports instances of arguments.caller and arguments.callee within JavaScript code.
  • Testing and Documentation: Comprehensive tests have been added, including Go-based unit tests and JavaScript-based RuleTester cases, along with detailed Markdown documentation for the new rule.
Changelog
  • internal/config/config.go
    • Imported the new no_caller rule package.
    • Registered the no-caller rule in the global rule registry.
  • internal/rules/no_caller/no_caller.go
    • Added a new Go file implementing the no-caller rule.
    • Defined the rule logic to detect arguments.callee and arguments.caller within PropertyAccessExpression AST nodes.
  • internal/rules/no_caller/no_caller.md
    • Created a new Markdown file providing documentation for the no-caller rule.
    • Included a description of the rule's purpose, examples of incorrect code, and examples of correct code.
    • Provided a link to the original ESLint documentation for reference.
  • internal/rules/no_caller/no_caller_test.go
    • Added a new Go test file for the no-caller rule.
    • Implemented rule_tester.RunRuleTester with valid and invalid test cases to verify the rule's functionality.
  • packages/rslint-test-tools/rstest.config.mts
    • Updated the test configuration to include the newly added no-caller.test.ts file.
  • packages/rslint-test-tools/tests/eslint/rules/snapshots/no-caller.test.ts.snap
    • Generated snapshot test outputs for the no-caller rule's diagnostics on invalid code examples.
  • packages/rslint-test-tools/tests/eslint/rules/no-caller.test.ts
    • Added a new TypeScript test file using RuleTester to define valid and invalid JavaScript code examples for the no-caller rule.
Activity
  • No human activity has been recorded on this pull request yet.
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 mentioned this pull request Mar 17, 2026
2 tasks
Copy link
Copy Markdown
Contributor

@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 no-caller rule from ESLint. The implementation is straightforward and includes documentation and tests. I've found one area for improvement in the rule's logic to make it more robust against edge cases not handled by the original ESLint rule. See my specific comment for details.

Comment thread internal/rules/no_caller/no_caller.go Outdated
@fansenze fansenze force-pushed the feat/port-rule-no-caller-20260317 branch from f069eb5 to 411adcf Compare April 3, 2026 04:25
@fansenze fansenze force-pushed the feat/port-rule-no-caller-20260317 branch from 411adcf to 8cca04a Compare April 3, 2026 04:27
@fansenze fansenze merged commit 78bb144 into main Apr 3, 2026
10 checks passed
@fansenze fansenze deleted the feat/port-rule-no-caller-20260317 branch April 3, 2026 05:59
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