ajv-validator / ajv-validator/ajv-formats
Type error running with ajv@8.11.2
- 主要言語
- TypeScript
- スター
- 228
- フォーク
- 42
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Hey, I'm not sure if this issue belongs here or to `ajv` package.
I get a ts error `Argument of type 'import("node_modules/ajv/dist/ajv").default' is not assignable to parameter of type 'import("node_modules/ajv-formats/node_modules/ajv/dist/core").default'.` when passing `ajv` object to `ajv-formats`:
```
import Ajv from "ajv";
import addAjvFormats from "ajv-formats";
const ajv = new Ajv();
addAjvFormats(ajv);
```
This is because `ajv` package holds 2 different definitions for `Ajv` class:
https://github.com/ajv-validator/ajv/blob/master/lib/core.ts#L275
https://github.com/ajv-validator/ajv/blob/master/lib/ajv.ts#L11
The first one is used in `ajv` default export type definition and the second one - in `ajv-formats` type definitions. Could you plz fix the typings, or better to address this issue to `ajv` package as they hold 2 divergent definitions?
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
評価
この issue はまだ評価されていません。