fix: say which strings an absolutePath keyword accepts - #223
Merged
alexander-akait merged 1 commit intoSep 8, 2026
Merged
Conversation
A string carrying the keyword was described as a plain `string`, so the list of accepted types offered `string` for a value like `"node_modules"` that is a string and is rejected. It reads `absolute path string` now, or `relative path string` for the `false` form - `output.filename` says so where its own description already did. The same report listed a failure once per branch that reached it: a rule condition is reachable both directly and through the array of conditions, so `exclude: ["node_modules"]` printed the whole rule type and the same detail twice. Children formatting to a message an earlier one produced are dropped, which leaves the single line naming the path. `getArticle` covers the string case as well now, so `empty string` no longer reads as `a empty string`. Fixes #66 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013wqLmVHkAGBsWQgXknEQCK
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #223 +/- ##
==========================================
+ Coverage 95.78% 95.96% +0.18%
==========================================
Files 9 9
Lines 949 967 +18
Branches 387 392 +5
==========================================
+ Hits 909 928 +19
+ Misses 36 35 -1
Partials 4 4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
alexander-akait
deleted the
claude/filter-errors-quadratic-sibling-dos-1tqe2l
branch
September 8, 2026 13:56
This was referenced Sep 8, 2026
Closed
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 #66.
Summary
Two things made a relative path given to a rule condition hard to read. Both are visible in the report on the issue.
The type list described a string carrying the
absolutePathkeyword as a plainstring, so it offeredstringfor"node_modules"— a string, and rejected.stringHintsalready qualifies a string type this way (minLength: 1readsnon-empty string), so the keyword now feeds the same mechanism:absolutePath: falsereadsrelative path string, which is howoutput.filenamenow describes itself — matching what its own schema description already said ("You must not specify an absolute path here!").Separately, a failure a schema reaches through more than one branch was listed once per branch.
excludeis aoneOfwhose branches both reach "array of conditions", soexclude: ["node_modules"]produced two identical details, which kept the single-child fast path from collapsing them and printed the whole rule type instead:Children formatting to a message an earlier one produced are dropped, which leaves:
What kind of change does this PR introduce?
A fix.
Did you add tests for your changes?
Yes, the case asked for on the issue - both spellings from the report driven against webpack's own schema, asserting the whole message rather than a fragment, plus one holding the type list to
absolute path string.Four snapshots move and each one improves: the duplicate detail line disappears, two
output.filenamereports gainrelative path string, and an array of absolute paths reads[integer, absolute path string, ...]. A fifth is an incidental grammar fix -getArticlecovers the string case now, soempty stringno longer reads as "a empty string".Does this PR introduce a breaking change?
No. The
errorsarray is untouched; only the rendered message changes.absolutePathis declared onExtendedSchema, where the other keywords of this package already live.If relevant, what needs to be documented once your changes are merged or what have you already documented?
n/a
Note on the earlier attempt in #68: it proposed moving
absolutePathfromaddKeywordtoaddFormatand adding ahumanizehelper. Neither is needed to get this reading, and the move would break consumers whose schemas use the keyword, so this takes the smaller path throughstringHints.🤖 Generated with Claude Code
https://claude.ai/code/session_013wqLmVHkAGBsWQgXknEQCK
Generated by Claude Code