Skip to content

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Aug 23, 2025

The prepublishOnly hook was incomplete compared to the CI quality checks, potentially allowing packages to be published with formatting issues that would later fail CI.

Problem

The current prepublishOnly script only ran:

"prepublishOnly": "npm test && npm run lint:check"

However, the CI pipeline (test-ci) also includes prettier formatting checks:

"test-ci": "npm run lint:check && npm run prettier:check && jest unit --coverage && ..."

This mismatch could lead to a scenario where:

  1. Developer makes changes locally
  2. prepublishOnly hook passes (tests + linting)
  3. Package gets published to npm
  4. CI fails due to prettier formatting issues

Solution

Updated the prepublishOnly script to include prettier formatting validation:

"prepublishOnly": "npm test && npm run lint:check && npm run prettier:check"

Now the prepublishOnly hook enforces the same quality standards as CI:

  • ✅ TypeScript definitions validity (tsd)
  • ✅ Unit tests pass (jest unit)
  • ✅ Code passes linting (eslint)
  • ✅ Code is properly formatted (prettier)

This ensures that only properly formatted, tested, and linted code can be published to npm, maintaining consistency with the project's quality standards.

Fixes #279.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copy link
Author

Copilot AI commented Aug 23, 2025

@naorpeled 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

Co-authored-by: naorpeled <6171622+naorpeled@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] prepublishOnly hook failing due to test failure Fix prepublishOnly hook by adding prettier formatting check Aug 23, 2025
@Copilot Copilot AI requested a review from naorpeled August 23, 2025 16:55
Copilot finished work on behalf of naorpeled August 23, 2025 16:55
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.

prepublishOnly hook failing due to test failure
2 participants