Skip to content

feat: add promise/avoid-new rule#1053

Merged
fansenze merged 4 commits into
mainfrom
feat/promise-avoid-new
Jun 10, 2026
Merged

feat: add promise/avoid-new rule#1053
fansenze merged 4 commits into
mainfrom
feat/promise-avoid-new

Conversation

@swwind

@swwind swwind commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Added promise/avoid-new 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:56

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

Adds the promise/avoid-new rule to the promise plugin, aligning behavior (and baseline tests) with eslint-plugin-promise rule avoid-new as part of the #474 rule-porting effort.

Changes:

  • Implement promise/avoid-new rule logic (report new Promise(...) when callee is the identifier Promise, matching upstream behavior).
  • Add upstream-aligned and extra edge/shape Go test suites, plus the corresponding TypeScript rule-tester suite and config registration.
  • Add rule documentation and extend the project dictionary for “promisify” terms.

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
scripts/dictionary.txt Adds “promisify/promisifying” to spelling dictionary.
packages/rslint-test-tools/tests/eslint-plugin-promise/rules/avoid-new.test.ts Adds TS-side RuleTester coverage for avoid-new.
packages/rslint-test-tools/rstest.config.mts Registers the new TS test file in the rstest include list.
internal/plugins/promise/rules/avoid_new/avoid_new.md Adds documentation for the new rule.
internal/plugins/promise/rules/avoid_new/avoid_new.go Implements the promise/avoid-new rule.
internal/plugins/promise/rules/avoid_new/avoid_new_upstream_test.go Ports upstream valid/invalid cases with position assertions.
internal/plugins/promise/rules/avoid_new/avoid_new_extras_test.go Adds additional edge-case coverage specific to this port/AST behavior.
internal/plugins/promise/all.go Registers avoid_new.AvoidNewRule in the promise plugin rule list.

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

Comment thread internal/plugins/promise/rules/avoid_new/avoid_new.md Outdated
swwind and others added 4 commits June 9, 2026 16:17
@swwind swwind force-pushed the feat/promise-avoid-new branch from 905c5f0 to 1fe6ad1 Compare June 9, 2026 08:17
@fansenze fansenze merged commit 3cdfa77 into main Jun 10, 2026
14 checks passed
@fansenze fansenze deleted the feat/promise-avoid-new branch June 10, 2026 03:21
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