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

Handle there being no parent module #19

Conversation

JulienKode
Copy link
Contributor

@JulienKode JulienKode commented Oct 30, 2020

Issue when there no parent module

Description

As describe here #18 it seems when there no parent module, we have an error. This is typically the case when we bundle with:

  • rollup
  • ncc
  • webpack

In this GitHub Action https://github.com/JulienKode/pull-request-name-linter-action we use import-fresh (actually commitlint/load are using it) and we bundle it with ncc

As we have a final bundle we do not have parent-module so we have this issue: JulienKode/pull-request-name-linter-action#61

Testing

I've added a test case to cover that, I did the module mocking manually. I understand that it's not the best way as some libraries can do that for us.

Fixes #18
Fixes #14

index.js Outdated Show resolved Hide resolved
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
@sindresorhus sindresorhus changed the title fix: issue when there no parent module Handle there being no parent module Nov 1, 2020
@sindresorhus sindresorhus merged commit 3d27ebc into sindresorhus:master Nov 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants