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

Rule "readonly-array" with option "ignore-return-type" doesn't work with generic parameters. #117

Closed
yxliang01 opened this issue Feb 17, 2019 · 3 comments

Comments

@yxliang01
Copy link

I think for the case of Promise<any[]>, it should still be ignored (covered by this option)?

@jonaskello
Copy link
Owner

You mean something like this will give warnings when using gnore-return-type option with readonly-array?

function foo(bar: string): Promise<Array<string> {
  return Promise.resolve([]);
}

In that case I agree, the whole return-type should be ignored, including generic params.

@yxliang01
Copy link
Author

@jonaskello Thanks for coming up with this minimal example. :) Yes, this is what I meant.

@RebeccaStevens
Copy link
Collaborator

I've been having this issue too. I've been meaning to make an issue on here for it for ages now but never got around to it. Anyway, I'll make a PR to fix this soonish.

@RebeccaStevens RebeccaStevens changed the title rule "readonly-array" with option "ignore-return-type" doesn't work with Promise<any[]> Rule "readonly-array" with option "ignore-return-type" doesn't work with generic parameters. Mar 6, 2019
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

No branches or pull requests

3 participants