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

New rule: prevent unsafe assignment of fp-ts types #728

Open
danielnixon opened this issue Mar 11, 2023 · 2 comments
Open

New rule: prevent unsafe assignment of fp-ts types #728

danielnixon opened this issue Mar 11, 2023 · 2 comments
Labels

Comments

@danielnixon
Copy link
Owner

export const foo: IO<string> = () => "hello";

// These assignments compile because the types are compatible, but the semantics are such that doing so is almost certainly an error.
export const bar: Lazy<string> = foo;
export const baz: () => string = foo;
@danielnixon
Copy link
Owner Author

We should also catch when a Promise is being assigned to an IO like IO.of(Axios.get(...)), or any async effect being assigned to an IO for that matter.

@danielnixon
Copy link
Owner Author

That latter point is covered by total-functions/no-nested-fp-ts-effects

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant