Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linter: incorrect fix for no-single-promise-in-promise-methods #9689

Open
oculus42 opened this issue Mar 11, 2025 · 0 comments · May be fixed by #9697
Open

linter: incorrect fix for no-single-promise-in-promise-methods #9689

oculus42 opened this issue Mar 11, 2025 · 0 comments · May be fixed by #9697
Assignees
Labels
A-linter Area - Linter C-bug Category - Bug

Comments

@oculus42
Copy link

oculus42 commented Mar 11, 2025

What version of Oxlint are you using?

v0.15.14

What command did you run?

npx oxlint --fix

What does your .oxlintrc.json config file look like?

// No config, just defaults

What happened?

Similar to #4093 but with a promise chain instead of await.

Promise.all(['one']).then((result) => result[0]);
Promise.all(['one']).then(([one]) => one);

This is fixed to the following incorrect code:

Promise.resolve('one').then((result) => result[0]);
Promise.resolve('one').then(([one]) => one);

oxlint in default config will fix Promise.all([a]) to Promise.resolve(a) without changing the consuming .then().

@oculus42 oculus42 added A-linter Area - Linter C-bug Category - Bug labels Mar 11, 2025
@camchenry camchenry self-assigned this Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linter Area - Linter C-bug Category - Bug
Projects
None yet
2 participants