ajv-validator / ajv-validator/ajv

Standalone esm option `--code-esm` is not recognized

Open
#2,354 1 comment 0 reactions 0 assignees View on GitHub
docs enhancement
Dominant language
TypeScript
Stars
14.8k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

**What version of Ajv are you using? Does the issue happen if you use the latest version?**

ajv-cli@5.0.0

The docs say:

> pass the --code-esm (CLI) flag if you want ESM exported code.

But when I do this:

```
ajv compile -s numeric.json --code-esm -o validate_schema.js
```

It gives this error:

```
error: parameter --code-esm is unknown
```

Indeed, in `ajv help compile`, there is no option listed for `--code.esm`. So, the documentation here is incorrect: https://ajv.js.org/standalone.html

Maybe related to #2209 -- is ESM module generation not working, and so the CLI option has been removed?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.