feat: add promise/no-new-statics rule#1052
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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-staticsrule implementation + documentation. - Added upstream-mirroring and extra-shape Go tests, plus JS/TS RuleTester coverage.
- Registered the new test file in
rslint-test-toolsand 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.
f499006 to
aa07b7d
Compare
aa07b7d to
559a6a4
Compare
559a6a4 to
1f18d13
Compare
fansenze
approved these changes
Jun 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Added
promise/no-new-staticsrule for #474.Related Links
original docs
Checklist