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

Using date-fns/fp while date-fns-tz is installed causes types to not infer correctly #237

Open
aniravi24 opened this issue May 4, 2023 · 0 comments

Comments

@aniravi24
Copy link

I have a pnpm node TypeScript project where I use date-fns and date-fns-tz.

A snippet like the following type checks, even though the second line should not be passing. When clicking into the import in VSCode for subDays, it's pointing me to date-fns-tz instead of date-fns, and the typings.ts file it takes me to use the old type definitions for the CurriedFn* interfaces instead of the ones introduced in this PR from date-fns.

import * as fns from "date-fns/fp";

console.log("date", fns.subDays(7, new Date()));
console.log("date", fns.subDays(new Date(), 7)); // this passes, but it shouldn't
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

1 participant