Skip to content

Conversation

@sushichan044
Copy link

@sushichan044 sushichan044 commented Oct 31, 2025

PR Checklist

Overview

This PR fixes the promise-function-async rule's fixer to correctly handle the override modifier when inserting the async keyword into method declarations.

The fixer was incorrectly placing async before override, generating invalid TypeScript syntax. The root cause was that the token-skipping logic only handled Keyword type tokens, but TypeScript's override is actually an Identifier token.

The fix extends the while loop condition to also skip Identifier tokens with the value 'override', ensuring that async is inserted in the correct position according to TypeScript's modifier order specification.

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @sushichan044!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint.

@netlify
Copy link

netlify bot commented Oct 31, 2025

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit e3d0dbb
🔍 Latest deploy log https://app.netlify.com/projects/typescript-eslint/deploys/6904a61a0cc5e40007a8d52e
😎 Deploy Preview https://deploy-preview-11730--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 90
Accessibility: 97
Best Practices: 100
SEO: 92
PWA: 80
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@sushichan044 sushichan044 changed the title fix(eslint-plugin): handle override modifier in promise-function-asyn… fix(eslint-plugin): handle override modifier in promise-function-async fixer Oct 31, 2025
@nx-cloud
Copy link

nx-cloud bot commented Oct 31, 2025

🤖 Nx Cloud AI Fix Eligible

An automatically generated fix could have helped fix failing tasks for this run, but Self-healing CI is disabled for this workspace. Visit workspace settings to enable it and get automatic fixes in future runs.

To disable these notifications, a workspace admin can disable them in workspace settings.


View your CI Pipeline Execution ↗ for commit e3d0dbb

Command Status Duration Result
nx run integration-tests:test ❌ Failed 53s View ↗
nx test eslint-plugin --coverage=false ✅ Succeeded 5m 7s View ↗
nx run-many -t lint ✅ Succeeded 3m 12s View ↗
nx run-many -t typecheck ✅ Succeeded 2m 1s View ↗
nx test eslint-plugin-internal --coverage=false ✅ Succeeded 4s View ↗
nx test typescript-estree --coverage=false ✅ Succeeded 1s View ↗
nx run types:build ✅ Succeeded 5s View ↗
nx run generate-configs ✅ Succeeded 5s View ↗
Additional runs (29) ✅ Succeeded ... View ↗

☁️ Nx Cloud last updated this comment at 2025-10-31 12:17:18 UTC

@codecov
Copy link

codecov bot commented Oct 31, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.66%. Comparing base (55ca033) to head (e3d0dbb).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #11730   +/-   ##
=======================================
  Coverage   90.66%   90.66%           
=======================================
  Files         518      518           
  Lines       52415    52417    +2     
  Branches     8678     8678           
=======================================
+ Hits        47521    47523    +2     
  Misses       4880     4880           
  Partials       14       14           
Flag Coverage Δ
unittest 90.66% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
.../eslint-plugin/src/rules/promise-function-async.ts 98.67% <100.00%> (+0.01%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sushichan044 sushichan044 marked this pull request as ready for review November 1, 2025 00:43
@sushichan044
Copy link
Author

sushichan044 commented Nov 1, 2025

Integration test is failing but not seems like caused by this PR.
https://github.com/typescript-eslint/typescript-eslint/actions/runs/18972004493/job/54181942681?pr=11730#step:5:199

Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! ✨

@JoshuaKGoldberg JoshuaKGoldberg added the 1 approval >=1 team member has approved this PR; we're now leaving it open for more reviews before we merge label Nov 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 approval >=1 team member has approved this PR; we're now leaving it open for more reviews before we merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: [promise-function-async] fixer generates invalid syntax with override keyword

2 participants