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

fix(isValidNodeImport): detect invalid cjs modules #187

Merged
merged 2 commits into from
Aug 25, 2023
Merged

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Aug 25, 2023

πŸ”— Linked issue

Resolves #186

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

We check for valid ESM modules to either use .mjs entries or type: "module" (this could later be improved to double check syntax on ESM too)

But when detecting valid CJS entries, we have to make sure there is no mixed syntax before validating module.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@pi0 pi0 requested a review from danielroe August 25, 2023 10:53
@codecov
Copy link

codecov bot commented Aug 25, 2023

Codecov Report

Merging #187 (9dc8116) into main (b7adabf) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #187   +/-   ##
=======================================
  Coverage   86.99%   86.99%           
=======================================
  Files           8        8           
  Lines        1007     1007           
  Branches      167      166    -1     
=======================================
  Hits          876      876           
  Misses        131      131           
Files Changed Coverage Ξ”
src/syntax.ts 96.93% <100.00%> (ΓΈ)

@pi0 pi0 merged commit cfa04fb into main Aug 25, 2023
@danielroe danielroe deleted the fix/valid-node branch August 25, 2023 21:57
@danielroe
Copy link
Member

πŸ‘Œ

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

Successfully merging this pull request may close these issues.

isValidNodeImport incorrectly returns true for mixed syntax
2 participants