date-fns: Typings's broken on latest Typescript (2.5.3)
I am not sure why but something in v2.5.3 has broken compilation of my project.
Could not find a declaration file for module 'date-fns/format'. '/path/to/my/project/node_modules/date-fns/format/index.js' implicitly has an 'any' type.
I’m using date-fns like this
import * as format from 'date-fns/format'
For now, I’ve reverted it back to Typescript v2.5.2 as it is working with no problems.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 22
- Comments: 21 (8 by maintainers)
Commits related to this issue
- Update typings based on new Typescript version. Issue: https://github.com/date-fns/date-fns/issues/572 — committed to dashmug/date-fns by dashmug 7 years ago
Hey guys, a quick fix is using the
requirestatement:const fromat = require('date-fns/format/index')@kossnocorp @leshakoss we need fixed typings 😄 could you please make a release?
@kossnocorp I’m just now running into this issue in v1. It looks like a fix was ready back in November, but hasn’t been released yet, as far as I can tell. Is there anything in particular holding up a release?
Looks like both have been merged. Can you give an idea when a new release will be available?
According to feedback from typescript maintainers:
And I tested it locally, it should work by creating
index.d.tsfile innode_modules/date-fns/format/with following code:Is there someone that can review #598 and #599 ? This issue need to be fixed.
temporary fix is easy enough:
just use type path mapping to your custom override of
formattsconfig.json