Skip to content

fix: ensure default-ruleset builds before linter tests - #1097

Closed
Shubh-Raj wants to merge 2 commits into
accordproject:mainfrom
Shubh-Raj:shubhraj/fix/linter-build-dependency
Closed

Shubh-Raj wants to merge 2 commits into
accordproject:mainfrom
Shubh-Raj:shubhraj/fix/linter-build-dependency

Conversation

@Shubh-Raj

Copy link
Copy Markdown
Contributor

Closes #1096

Fix build order issue causing linter tests to fail on fresh clones by ensuring default-ruleset builds before tests run.

Changes

  • Update pretest script in packages/concerto-linter/package.json
  • Build @accordproject/concerto-linter-default-ruleset workspace before running lint
  • Prevents module resolution error: Cannot find module '@accordproject/concerto-linter-default-ruleset'

Flags

  • Breaking: No
  • Tested: Verified by removing dist/ folder and running npm test - all 18 tests passed
  • Impact: Improves developer experience for new contributors and fixes CI on clean environments

Screenshots or Video

Before Fix: npm test results in src/index.ts:19:31 - error TS2307: Cannot find module '@accordproject/concerto-linter-default-ruleset'. After Fix: All 18 tests pass successfully including configLoader.test.ts, lintModel.test.ts, loadRuleset.test.ts, and formatResults.test.ts

Related Issues

Author Checklist

  • Ensure you provide a DCO sign-off for your commits using the --signoff option of git commit.
  • Vital features and changes captured in unit and/or integration tests
  • Commits messages follow AP format
  • Extend the documentation, if necessary
  • Merging to main from fork:branchname

- Update pretest script to build default-ruleset workspace before running lint
- Prevents module resolution error on fresh clones/CI environments
- Fixes test failure: Cannot find module '@accordproject/concerto-linter-default-ruleset'

This ensures the dist/ folder exists before tests try to import from
default-ruleset, fixing the developer experience for new contributors.

Signed-off-by: Shubh-Raj <shubhraj625@gmail.com>
@mttrbrts
mttrbrts requested a review from Copilot January 6, 2026 14:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a build order issue where linter tests fail on fresh clones due to a missing dependency build. The fix ensures the default-ruleset package is built before running tests.

Key Changes:

  • Modified the pretest script to build the default-ruleset workspace before running lint
  • Prevents module resolution errors when running tests in clean environments

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/concerto-linter/package.json Resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Matt Roberts <7544022+mttrbrts@users.noreply.github.com>
@mttrbrts mttrbrts closed this Jan 6, 2026
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.

fix: concerto-linter tests fail on fresh clones

3 participants