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

Problem with autofix for no-single-promise-in-promise-methods #2385

Closed
ItamarKieslerFabric opened this issue Jun 18, 2024 · 1 comment · Fixed by #2386
Closed

Problem with autofix for no-single-promise-in-promise-methods #2385

ItamarKieslerFabric opened this issue Jun 18, 2024 · 1 comment · Fixed by #2386
Labels

Comments

@ItamarKieslerFabric
Copy link

Hi,
Thank you for creating and maintaining this plugin.

When autofixing no-single-promise-in-promise-methods code might break:

Original code:

const results = await Promise.all([somePromise]);
doSomething(results[0]);

Autofixed code:

const results = await somePromise;
doSomething(results[0]); // Problem, results is no longer an array

I don't know if it's possible to automatically identify the usages of the resolved array and fix them, if not maybe not autofix?

Thanks

@ItamarKieslerFabric ItamarKieslerFabric changed the title Problem with autofix for no-single-promise-in-promise-methods Problem with autofix for no-single-promise-in-promise-methods Jun 18, 2024
@fisker
Copy link
Collaborator

fisker commented Jun 18, 2024

//cc @Clement398

Clement398 added a commit to Clement398/eslint-plugin-unicorn that referenced this issue Jun 21, 2024
Clement398 added a commit to Clement398/eslint-plugin-unicorn that referenced this issue Jun 21, 2024
Clement398 added a commit to Clement398/eslint-plugin-unicorn that referenced this issue Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants