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

Add no-thenable rule #1616

Merged
merged 19 commits into from
Dec 27, 2021
Merged

Add no-thenable rule #1616

merged 19 commits into from
Dec 27, 2021

Conversation

fisker
Copy link
Collaborator

@fisker fisker commented Nov 22, 2021

Fixes #1596

@fisker fisker changed the title Add no-thenable rule Add no-thenable rule Nov 22, 2021
@fisker fisker marked this pull request as ready for review November 22, 2021 13:51

✅ *This rule is part of the [recommended](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config) config.*

If an object is defined as "thenable", once it's accidentally used in an await expression, it may cause problems.
Copy link
Owner

Choose a reason for hiding this comment

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

It should describe what kind of problem.

docs/rules/no-thenable.md Outdated Show resolved Hide resolved

✅ *This rule is part of the [recommended](https://github.com/sindresorhus/eslint-plugin-unicorn#recommended-config) config.*

If an object is defined as "thenable", once it's accidentally used in an await expression, it may cause problems.
Copy link
Sponsor Contributor

Choose a reason for hiding this comment

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

Any docs to link to about this for context?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I can't find any link for this.

fisker and others added 2 commits December 16, 2021 17:43
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
@fisker
Copy link
Collaborator Author

fisker commented Dec 16, 2021

I've added some example to show the problems.

docs/rules/no-thenable.md Outdated Show resolved Hide resolved
@sindresorhus sindresorhus merged commit c318644 into sindresorhus:main Dec 27, 2021
@fisker fisker deleted the no-thenable branch December 28, 2021 01:33
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.

Rule proposal: no-thenable
3 participants