Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Open
Description
Before You File a Bug Report Please Confirm You Have Done The Following...
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I havesearched for related issues and found none that matched my issue.
- I haveread the FAQ and my problem is not listed.
Playground Link
Repro Code
classBase{asyncfoo(){returnPromise.resolve(42);}}classDerivedextendsBase{overridefoo(){returnPromise.resolve(2000)}}
ESLint Config
module.exports={parser:"@typescript-eslint/parser",rules:{"@typescript-eslint/promise-function-async":"error"}};
tsconfig
{"compilerOptions": {// ... }}Expected Result
The fixer should produce valid TypeScript syntax with the async keyword placed after the override modifier, following TypeScript's correct modifier order.
classBase{asyncfoo(){returnPromise.resolve(42);}}classDerivedextendsBase{overrideasyncfoo(){returnPromise.resolve(2000)}}
Actual Result
The fixer generates invalid syntax by placing the async keyword before the override modifier, which violates TypeScript's modifier ordering rules and causes a syntax error.
classBase{asyncfoo(){returnPromise.resolve(42);}}classDerivedextendsBase{asyncoverridefoo(){returnPromise.resolve(2000)}}
Additional Info
The root cause is that the fixer's token-skipping logic only handles Keyword type tokens such as public and static, but TypeScript's override is classified as an Identifier token.
This causes the insertion point to be calculated incorrectly, resulting in invalid modifier ordering.