Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation for usage in ESM #264

Open
octo-topi opened this issue Apr 26, 2023 · 1 comment
Open

Add documentation for usage in ESM #264

octo-topi opened this issue Apr 26, 2023 · 1 comment

Comments

@octo-topi
Copy link

If a repository is full-ESM (type="module" in package.json)

The following scenario fail.

  • configuration file in ESM, extension js
Error [ERR_REQUIRE_ESM]: require() of ES Module pix/api/tests/acceptance/database/configuration.js from pix/api/node_modules/schemalint/build/cli.js not supported.

  • configuration file in CJS, extension js
Error [ERR_REQUIRE_ESM]: require() of ES Module /pix/api/tests/acceptance/database/configuration.js from pix/api/node_modules/schemalint/build/cli.js not supported.
configuration.js is treated as an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" 

A following scenario works:

  • a configuration file in CJS, extension cjs:
  • a invocation using this file schemalint --config tests/acceptance/database/configuration.cjs

It would be much useful to mention it in documentation.

@kristiandupont
Copy link
Owner

You are right, that's a good point. Thank you for letting me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants