Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[promise-function-async] Should not report for returned union types containing non-promise #1005

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

Closed
sindresorhus opened this issue Sep 24, 2019 · 0 comments · Fixed by #1023
Labels
bug Something isn't working good first issue Good for newcomers has pr there is a PR raised to close this package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@sindresorhus
Copy link

{
	'@typescript-eslint/promise-function-async': [
		'error',
		{
			allowAny: true
		}
	]
}
type Return = NodeJS.ReadableStream | Promise;

const promiseOrStream = (options: Options): Return => options.stream ? asStream(options) : asPromise(options);

Expected Result

I expected it to not report as adding an async keyword there will not work.

Actual Result

It reports.

Additional Info

It should only report when the return value is a Promise.

Versions

package version
@typescript-eslint/eslint-plugin 2.3.1
@typescript-eslint/parser 2.3.1
TypeScript 3.6.3
ESLint 6.4.0
node 12.10.0
npm 6.11.3
@sindresorhus sindresorhus added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for team members to take a look labels Sep 24, 2019
@bradzacher bradzacher added bug Something isn't working good first issue Good for newcomers and removed triage Waiting for team members to take a look labels Sep 24, 2019
@bradzacher bradzacher added the has pr there is a PR raised to close this label Sep 30, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working good first issue Good for newcomers has pr there is a PR raised to close this package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
2 participants