feat: port rule promise/no-promise-in-callback#1065
Open
elecmonkey wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Ports promise/no-promise-in-callback into rslint’s eslint-plugin-promise implementation, wiring it into the promise plugin, adding documentation, and adding both Go + JS harness test coverage so the rule can ship enabled in presets.
Changes:
- Implement
promise/no-promise-in-callbackrule in the Go promise plugin. - Add upstream-migrated + rslint-specific extra Go test suites, plus JS RuleTester coverage and test-runner registration.
- Enable the rule in the
promiserecommended config and register it in the promise plugin rule list.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/rslint/src/configs/promise.ts | Enables promise/no-promise-in-callback in the promise recommended preset. |
| packages/rslint-test-tools/tests/eslint-plugin-promise/rules/no-promise-in-callback.test.ts | Adds JS RuleTester cases for the new rule. |
| packages/rslint-test-tools/rstest.config.mts | Registers the new JS test file in the test runner config. |
| internal/plugins/promise/rules/no_promise_in_callback/no_promise_in_callback.md | Adds user-facing rule documentation. |
| internal/plugins/promise/rules/no_promise_in_callback/no_promise_in_callback.go | Implements the rule logic + options parsing + reporting. |
| internal/plugins/promise/rules/no_promise_in_callback/no_promise_in_callback_upstream_test.go | Ports the upstream valid/invalid suite into Go tests. |
| internal/plugins/promise/rules/no_promise_in_callback/no_promise_in_callback_extras_test.go | Adds additional edge-shape / branch lock-in Go tests. |
| internal/plugins/promise/all.go | Registers the new rule in the promise plugin’s exported rule list. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
10
to
+14
| 'promise/param-names': 'error', | ||
| // 'promise/catch-or-return': 'error', // not implemented | ||
| // 'promise/no-native': 'off', // not implemented | ||
| // 'promise/no-nesting': 'warn', // not implemented | ||
| // 'promise/no-promise-in-callback': 'warn', // not implemented | ||
| 'promise/no-promise-in-callback': 'warn', |
Member
Author
There was a problem hiding this comment.
the inconsistent introduced by catch-or-return's porting PR. should not fix in this PR.
b056d17 to
202d6f7
Compare
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
promise/no-promise-in-callback
Related Links
Checklist