Repository navigation
Conversation
getExitCode counted a problem unless it carried resolutionKind and that kind was ignored. Eight problem kinds carry no resolutionKind, so a problem that affects only ignored resolutions still produced exit 1. Count a problem only when it affects a resolution that is not ignored.
🦋 Changeset detectedLatest commit: 0546cac The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #284.
getExitCodehonoured--profileonly for problems carrying aresolutionKindfield (4 of 12 kinds). The other eight always counted toward exit 1, so--profile esm-onlyexited 1 on a package whose only problems were visible under node10 or node16-cjs, while the table labelled them "(ignored)".Change
getExitCodenow counts a problem when it is not rule-ignored andproblemAffectsResolutionKindis true for at least one resolution kind the profile does not ignore. That is the predicaterender/typed.tsalready uses for "(ignored per resolution)", so the exit code and the table agree. No change to core or to problem shapes, so this composes with #278.Tests
packages/cli/test/getExitCode.test.ts, on in-memory packages: anInternalResolutionErrorvisible only under node10 and aFalseCJSvisible only under node16-cjs exit 0 under["node10", "node16-cjs"]and 1 when the resolution they appear in is required (both exit-0 assertions fail onmainwithactual: 1, expected: 0); a problem visible in all four kinds still exits 1 while any of its kinds is required;--ignore-rulesstill applies to required resolutions. Core and CLI snapshots are unchanged.Known limit
Core computes
moduleKindsfor node16 only (checkPackage.ts), soFalseCJS,FalseESMandUnexpectedModuleSyntaxare never attributed tobundler. The table already shows nothing for them in the bundler cell; the exit code now follows the table there too.Investigated and drafted with AI assistance; the reproduction is on #284 and the tests here are for you to check.