Repository navigation
Refactor duplicated helpers and fix local lint traversal - #23
Merged
Merged
Conversation
Share subject normalization, tooltip anchors, balance rows, ghost attribute scoping, fallback amount formatting, validation errors, minimum-width growth and crossing predicates. Reuse the demo formatter and showConverted helper, and share the test input-error assertion.
ESLint and Prettier were traversing ignored .claude/worktrees copies, producing unrelated failures. Ignore that directory plus generated Playwright output.
Treat absent subjects as distinct in same(), keep emphasis() strict for malformed entries while retaining shared existence logic, and build minLinkWidth error messages only after a failed width check. Add regression coverage for the subject helpers.
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.
Summary
Behavior-preserving refactor that removes duplicated helper logic across the library, demo, and tests. It also fixes local lint/format checks so they no longer traverse ignored
.claude/worktrees.Library
subjectList()and reusesubjectExists()inemphasis().SankeyDiagram.presentation.paths.Demo and tests
demo/format.tsfor the formatter previously copied in three demo files.showConverted()andsame()instead of maintaining demo-local copies.tests/helpers.tsfor the sharederror()assertion used by the core and unit suites.Tooling
.claude/,playwright-report/, andtest-results/in ESLint..claude/in Prettier.Follow-up hardening
same()and cover it with regression tests.emphasis()strict for malformed subject entries while sharing the existence logic.minLinkWidthexpansion errors only after a failed width check.Verification
npm run typechecknpm run lintnpm run format:checknpm test- 169/169 passednpm run buildnpm run test:browser- 17/17 passednpm run verify:packageNo rendered output, default styling, public API, or package contents changed, so no screenshots are included.