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: read version number from lint-staged package.json (#1043) #1044

Merged
merged 1 commit into from Nov 13, 2021
Merged

fix: read version number from lint-staged package.json (#1043) #1044

merged 1 commit into from Nov 13, 2021

Conversation

coalman
Copy link
Contributor

@coalman coalman commented Nov 13, 2021

I think the current code is reading package.json from the current working directory.

If the package.json did not have a version number, it would cause lint-staged to crash.

…kage.json in cwd (#1043)

If the package.json did not have a version number, it would cause lint-staged to crash.
@iiroj
Copy link
Member

iiroj commented Nov 13, 2021

It seems that reading JSON is problematic with ESM... it should read lint-staged's own version number.

bin/lint-staged.js Show resolved Hide resolved
Copy link
Member

@iiroj iiroj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

@codecov
Copy link

codecov bot commented Nov 13, 2021

Codecov Report

Merging #1044 (2d694f2) into master (7240f61) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##            master     #1044   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           20        20           
  Lines          577       577           
  Branches       156       156           
=========================================
  Hits           577       577           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7240f61...2d694f2. Read the comment docs.

@iiroj iiroj merged commit 9f9213d into lint-staged:master Nov 13, 2021
@github-actions
Copy link
Contributor

🎉 This PR is included in version 12.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@coalman coalman deleted the fix-package-json-path branch November 13, 2021 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

2 participants