-
-
Notifications
You must be signed in to change notification settings - Fork 13
chore: fix mark property types + linting issues #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for svelteplot ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
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 mark property type definitions and addresses various linting issues across the codebase.
- Updated mark type definitions and refactored variable declarations in several Svelte components.
- Added keyed each loops and improved import consistency for linting and performance.
- Updated dependency versions and added a new linting workflow.
Reviewed Changes
Copilot reviewed 93 out of 93 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
src/lib/marks/AxisX.svelte | Refactored mark property types and variable declarations using const and type casts. |
src/lib/marks/Arrow.svelte | Reorganized scripts, updated type annotations, and added keyed each loops. |
src/lib/marks/AreaY.svelte | Simplified type definitions using Omit for clarity. |
src/lib/marks/AreaX.svelte | Adjusted type usage by omitting unused properties. |
src/lib/marks/Area.svelte | Updated type annotations and added keyed each loops in templating. |
src/lib/helpers/typeChecks.ts | Applied minor formatting improvements. |
src/lib/helpers/scales.ts | Reformatted conditional logic for clarity. |
src/lib/helpers/resolve.ts | Improved optional chaining and introduced a debug logging block. |
src/lib/helpers/reduce.ts | Optimized and consolidated import statements. |
src/lib/helpers/index.ts | Optimized import statements for consistency. |
src/lib/helpers/autoScales.ts | Fixed missing semicolon for better style conformity. |
src/lib/core/Plot.svelte, FacetGrid.svelte, Mark.svelte | Added keyed each loops to improve list rendering stability. |
package.json | Updated dependency versions and scripts. |
.github/workflows/lint.yml | Added a new linting workflow to support CI. |
.github/ISSUE_TEMPLATE/feature_request.md | Made minimal formatting adjustments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This chore updates mark property typings, resolves lint errors, and bumps various dependencies.
- Refactored Svelte mark components to use module scripts for type exports and cleaned up props.
- Added
key
directives to all{#each}
loops and applied optional chaining/null-safety fixes in helpers. - Updated imports to single-line style, bumped dependencies, and introduced a GitHub Actions lint workflow.
Reviewed Changes
Copilot reviewed 100 out of 100 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
src/lib/marks/Arrow.svelte | Split module vs. instance scripts and updated ArrowMarkProps definition. |
src/lib/marks/Area.svelte | Consolidated AreaMarkProps , added title rendering, removed unused facet logic. |
src/lib/helpers/resolve.ts | Added optional chaining and expanded conditional formatting. |
config/sidebar.ts | Reordered sidebar entries for "Vector". |
.github/workflows/lint.yml | Added a linting workflow on push and PRs. |
Comments suppressed due to low confidence (4)
src/lib/marks/Arrow.svelte:36
- The
ArrowMarkProps
type no longer includes achildren?: Snippet
field, but the component still referenceschildren
. Consider addingchildren?: Snippet
back to the type to keep the API consistent.
};
src/lib/marks/Area.svelte:117
- You’ve introduced conditional rendering of
<title>
based onoptions.title
, but there’s no test covering this behavior. Consider adding a unit test to verify the<title>
appears whentitle
is provided.
{@const title = resolveProp(options.title, datum.datum, '')}
src/lib/marks/Arrow.svelte:84
- [nitpick] Using the array index as the Svelte
key
can cause rendering issues when items are reordered. If possible, use a stable identifier from each data item instead ofi
.
{#each scaledData as d, i (i)}
config/sidebar.ts:74
- [nitpick] The sidebar order now places 'Vector' after 'Tick', breaking the previous ordering. Consider reordering entries alphabetically or grouping consistently to keep the navigation predictable.
{ title: 'Vector', to: '/marks/vector' }
This pull request introduces several updates across the codebase, including dependency upgrades, improved linting workflows, bug fixes, and enhancements to chart components. Below is a categorized summary of the most important changes:
Dependency Upgrades
package.json
, including@sveltejs/kit
(to^2.21.1
),eslint
(to^9.27.0
),eslint-plugin-svelte
(to3.9.0
),vitest
(to^3.1.4
), andsvelte
(to5.33.2
) for compatibility and performance improvements. [1] [2] [3] [4]Workflow Enhancements
.github/workflows/lint.yml
) to automate lint checks onpush
andpull_request
events targeting themain
branch. This ensures code quality is maintained consistently.Bug Fixes and Code Improvements
#each
blocks in multiple Svelte components (Mark.svelte
,Plot.svelte
,FacetGrid.svelte
, andArea.svelte
) to optimize rendering and avoid potential issues with dynamic lists. [1] [2] [3] [4]resolveProp
,resolve
, andresolveStyles
, by restructuring conditional logic and adding null-safe operations. [1] [2] [3] [4]Chart Component Enhancements
Area.svelte
to enhance its API by consolidating properties intoAreaMarkProps
and adding support for titles within<path>
elements. This improves the usability and accessibility of area charts. [1] [2] [3] [4] [5]AreaX.svelte
andAreaY.svelte
components to provide better clarity on their purposes and usage. These components create horizontal and vertical area charts, respectively. [1] [2]Miscellaneous Improvements
index.ts
,reduce.ts
) to improve code organization and maintainability. [1] [2]These changes collectively improve the functionality, maintainability, and performance of the codebase while ensuring adherence to modern development practices.