Skip to content

feat: add promise/no-new-statics rule#1052

Merged
fansenze merged 3 commits into
mainfrom
port/promise-no-new-statics
Jun 17, 2026
Merged

feat: add promise/no-new-statics rule#1052
fansenze merged 3 commits into
mainfrom
port/promise-no-new-statics

Conversation

@swwind

@swwind swwind commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Added promise/no-new-statics rule for #474.

Related Links

original docs

Checklist

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

Copilot AI review requested due to automatic review settings June 5, 2026 02:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Ports eslint-plugin-promise’s promise/no-new-statics rule into rslint to prevent (and autofix) incorrect new Promise.<static>() usages, aligning with the tracking work in #474.

Changes:

  • Added the promise/no-new-statics rule implementation + documentation.
  • Added upstream-mirroring and extra-shape Go tests, plus JS/TS RuleTester coverage.
  • Registered the new test file in rslint-test-tools and registered the rule in the promise plugin rule list.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/rslint-test-tools/tests/eslint-plugin-promise/rules/no-new-statics.test.ts Adds JS/TS RuleTester cases for no-new-statics.
packages/rslint-test-tools/rstest.config.mts Includes the new promise rule test in the test runner config.
internal/plugins/promise/rules/no_new_statics/no_new_statics.md Adds user-facing rule documentation and notes TS-wrapper divergence.
internal/plugins/promise/rules/no_new_statics/no_new_statics.go Implements the rule + autofix (currently with a brittle fix range).
internal/plugins/promise/rules/no_new_statics/no_new_statics_upstream_test.go Ports upstream test cases for parity.
internal/plugins/promise/rules/no_new_statics/no_new_statics_extras_test.go Adds additional shape/branch-lock and autofix behavior tests.
internal/plugins/promise/all.go Registers the new rule in the promise plugin.

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

Comment thread internal/plugins/promise/rules/no_new_statics/no_new_statics.go Outdated
Comment thread internal/plugins/promise/rules/no_new_statics/no_new_statics.go
@swwind swwind changed the title feat: added promise/no-new-statics rule feat: add promise/no-new-statics rule Jun 5, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 8, 2026

Copy link
Copy Markdown

Deploying rslint with  Cloudflare Pages  Cloudflare Pages

Latest commit: 52ea121
Status:🚫  Build failed.

View logs

@swwind swwind force-pushed the port/promise-no-new-statics branch 2 times, most recently from f499006 to aa07b7d Compare June 16, 2026 07:01
@swwind swwind force-pushed the port/promise-no-new-statics branch from aa07b7d to 559a6a4 Compare June 16, 2026 08:37
@swwind swwind force-pushed the port/promise-no-new-statics branch from 559a6a4 to 1f18d13 Compare June 17, 2026 08:09
@fansenze fansenze enabled auto-merge (squash) June 17, 2026 08:10
@fansenze fansenze merged commit f3e298e into main Jun 17, 2026
14 checks passed
@fansenze fansenze deleted the port/promise-no-new-statics branch June 17, 2026 08:54
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