Andrew Branch
Andrew Branch
Ryan and I have investigated two specific instances of this double-default problem in the last two days. One was [ajv](https://unpkg.com/browse/[email protected]/); the other was [react-use-websocket](https://unpkg.com/browse/[email protected]/). Both had users reporting that after...
This kind of error pretty much always indicates that the types use `export default` when they should use `export =` instead. That’s the case for fuse.js: https://arethetypeswrong.github.io/?p=fuse.js%406.6.2. I put up...
It does support subpath patterns. I’d recommend using `tsc --traceResolution` to figure out what’s going wrong in your case.
> Please check it out and tell me if you encounter any problems. This is what https://arethetypeswrong.github.io/?p=date-fns%403.0.0-alpha.1 is doing. > I tested it on a TypeScript project, plus I added...
> If I do: > > ```ts > import Ajv from "ajv" > export const getClient = ():Ajv.default => { > return new Ajv.default() > } > ``` > Then...
FWIW, [my comment above](https://github.com/ajv-validator/ajv/issues/2132#issuecomment-1653983999) is PR-able and will fully fix the types. I didn’t PR it because I noticed that no meaningful changes have been made to this repo in...
It looks like this will do the trick ```diff class Ajv extends AjvCore { + static default = Ajv // ... } - module.exports = exports = Ajv + export...
How about instead of the `default` static property, we do this: ```diff export = Ajv Object.defineProperty(Ajv, "__esModule", {value: true}) + Object.defineProperty(Ajv, "default", {value: Ajv}) + declare namespace Ajv { +...
That’s all eslint.
I would appreciate some help testing #52217 if anyone is interested in trying this out early.