ajv-validator / ajv-validator/ajv-cli

"ajv compile --code-esm" outputs "error: parameter --code-esm is unknown"

Đang mở
#236 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
316
Fork
77
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Hi Folks. I'm trying to compile my schema to an ES module, but my command `npx ajv compile --code-esm -s src/schema.json -o src/validate.js` prints `error: parameter --code-esm is unknown` in spite of that option being documented at https://ajv.js.org/standalone.html :
> Set the code.esm (JS) value to true or pass the --code-esm (CLI) flag if you want ESM exported code.

Running that command without `--code-esm` prints `schema src/schema.json is valid` and generates `src/validate.js`, which shows my inputs are otherwise ok.

**What version of Ajv are you using? Does the issue happen if you use the latest version?**
- "ajv": "^8.12.0"
- "ajv-cli": "^5.0.0"
- npm --version # 9.5.0
- node --version # v18.15.0

Note that running `npm install --save-dev ajv` resulted in version 6.12.6 being installed (!), so I had to manually run `npm install --save-dev ajv@8.12.0` to get the latest version. Maybe I screwed something up?

**What results did you expect?**
Output with no error.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.