Skip to content

@typescript-eslint/no-dynamic-delete#481

Merged
ScriptedAlchemy merged 19 commits intomainfrom
codex/ts-eslint-no-dynamic-delete-51aa
Mar 19, 2026
Merged

@typescript-eslint/no-dynamic-delete#481
ScriptedAlchemy merged 19 commits intomainfrom
codex/ts-eslint-no-dynamic-delete-51aa

Conversation

@ScriptedAlchemy
Copy link
Copy Markdown
Contributor

Summary: Port @typescript-eslint/no-dynamic-delete from ScriptedAlchemy#13.

Related Links:

Checklist:

  • Tests updated
  • Documentation updated (rule md)

@gemini-code-assist
Copy link
Copy Markdown

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/no-dynamic-delete rule, ported from ScriptedAlchemy/rslint#13, to enhance code quality and prevent potential runtime errors in TypeScript projects. The rule specifically targets the misuse of the delete operator with non-literal computed property keys, promoting safer and more predictable object manipulation.

Highlights

  • New Rule Implementation: Implemented the @typescript-eslint/no-dynamic-delete rule, which disallows the delete operator on dynamically computed property keys unless the key is a literal. This helps prevent unexpected runtime behavior and improves code safety.
  • Rule Integration: The new rule has been integrated into the rslint configuration, including its import, registration, and default setting to off in rslint.json.
  • Comprehensive Testing: Dedicated unit tests and snapshot tests have been added to validate the rule's behavior, covering various valid and invalid use cases for dynamic delete operations.
  • Documentation: New documentation (no_dynamic_delete.md) has been created, detailing the rule's purpose, providing examples of correct and incorrect code, and linking to the original typescript-eslint documentation.
Changelog
  • internal/config/config.go
    • Imported the no_dynamic_delete rule package.
    • Registered the NoDynamicDeleteRule with the global rule registry.
  • internal/plugins/typescript/rules/no_dynamic_delete/no_dynamic_delete.go
    • Added the core logic for the no-dynamic-delete rule, including functions to build rule messages and determine allowed delete arguments.
    • Defined the NoDynamicDeleteRule to detect and report dynamic delete expressions on non-literal property keys.
  • internal/plugins/typescript/rules/no_dynamic_delete/no_dynamic_delete.md
    • Added documentation for the no-dynamic-delete rule, explaining its purpose and providing code examples.
  • internal/plugins/typescript/rules/no_dynamic_delete/no_dynamic_delete_test.go
    • Added a comprehensive suite of unit tests for the no-dynamic-delete rule, covering both valid and invalid code scenarios.
  • packages/rslint-test-tools/rstest.config.mts
    • Uncommented and enabled the test file for no-dynamic-delete in the test configuration.
  • packages/rslint-test-tools/tests/typescript-eslint/rules/snapshots/no-dynamic-delete.test.ts.snap
    • Added snapshot test results for the no-dynamic-delete rule's invalid cases.
  • rslint.json
    • Added @typescript-eslint/no-dynamic-delete rule to the configuration, setting its default level to off.
Activity
  • The @typescript-eslint/no-dynamic-delete rule has been ported from ScriptedAlchemy/rslint#13.
  • Tests have been updated to include coverage for the new rule.
  • Documentation for the new rule has been created and updated.
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
Copy Markdown

@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/no-dynamic-delete rule. The implementation is clean and follows the project's structure. The added tests are comprehensive. I've found a minor correctness issue in handling parenthesized numeric literals and also a small suggestion to improve performance by defining the rule message as a package-level variable to avoid repeated allocations.

@ScriptedAlchemy ScriptedAlchemy marked this pull request as ready for review February 26, 2026 03:45
Copilot AI review requested due to automatic review settings February 26, 2026 03:45
@ScriptedAlchemy ScriptedAlchemy enabled auto-merge (squash) February 26, 2026 03:45
Copy link
Copy Markdown
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

Ports the @typescript-eslint/no-dynamic-delete rule into this codebase (implementation + registration), and enables/extends the cross-runner test coverage to validate behavior against the TypeScript ESLint rule expectations.

Changes:

  • Added the no-dynamic-delete rule implementation, documentation, and Go rule-tester coverage.
  • Registered the rule under @typescript-eslint/no-dynamic-delete in the global TypeScript ESLint plugin registry.
  • Enabled and expanded the rslint-test-tools TypeScript test and added its snapshot output.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
rslint.json Adds the new rule to the example/config ruleset (defaulted to off).
packages/rslint-test-tools/tests/typescript-eslint/rules/no-dynamic-delete.test.ts Adds an additional invalid test case for dynamic delete.
packages/rslint-test-tools/tests/typescript-eslint/rules/snapshots/no-dynamic-delete.test.ts.snap Introduces the snapshot baselines for the test suite output.
packages/rslint-test-tools/rstest.config.mts Enables running the no-dynamic-delete test in the rstest suite.
internal/plugins/typescript/rules/no_dynamic_delete/no_dynamic_delete.go Implements the rule logic and diagnostic reporting.
internal/plugins/typescript/rules/no_dynamic_delete/no_dynamic_delete_test.go Adds Go-based rule tester coverage (valid/invalid cases + locations).
internal/plugins/typescript/rules/no_dynamic_delete/no_dynamic_delete.md Adds rule documentation and a link to upstream docs.
internal/config/config.go Registers @typescript-eslint/no-dynamic-delete in the rule registry.

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

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Mar 3, 2026

Deploying rslint with  Cloudflare Pages  Cloudflare Pages

Latest commit: c560257
Status: ✅  Deploy successful!
Preview URL: https://38a89728.rslint.pages.dev
Branch Preview URL: https://codex-ts-eslint-no-dynamic-d.rslint.pages.dev

View logs

@ScriptedAlchemy ScriptedAlchemy merged commit 80d6c1e into main Mar 19, 2026
15 checks passed
@ScriptedAlchemy ScriptedAlchemy deleted the codex/ts-eslint-no-dynamic-delete-51aa branch March 19, 2026 02:12
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