From ee488fb879dbb112fae3d309ceaadfd4af9759e6 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Thu, 29 May 2025 00:05:58 +0000 Subject: [PATCH] style: format code with Prettier This commit fixes the style issues introduced in 0bbe781 according to the output from Prettier. Details: None --- .rules/guidelines/coding.md | 6 + .rules/guidelines/javascript.md | 1 + .rules/guidelines/svelte.md | 2 + .rules/llms.md | 8 +- packages/chart/README.md | 13 +- packages/chart/spec/brewing/axes.spec.js | 456 +++++++++--------- .../chart/spec/brewing/dimensions.spec.js | 174 +++---- packages/chart/spec/brewing/scales.spec.js | 305 ++++++------ packages/chart/src/index.js | 26 +- packages/chart/src/lib/brewing/axes.svelte.js | 242 +++++----- packages/chart/src/lib/brewing/bars.svelte.js | 140 +++--- .../src/lib/brewing/dimensions.svelte.js | 48 +- .../chart/src/lib/brewing/index.svelte.js | 396 ++++++++------- .../chart/src/lib/brewing/legends.svelte.js | 103 ++-- .../chart/src/lib/brewing/scales.svelte.js | 127 +++-- packages/chart/src/lib/brewing/types.js | 4 +- packages/chart/src/lib/context.js | 224 +++++---- packages/chart/src/lib/scales.svelte.js | 167 +++---- packages/chart/src/lib/utils.js | 142 +++--- 19 files changed, 1288 insertions(+), 1296 deletions(-) diff --git a/.rules/guidelines/coding.md b/.rules/guidelines/coding.md index 42562b5b2..88660cc58 100644 --- a/.rules/guidelines/coding.md +++ b/.rules/guidelines/coding.md @@ -1,12 +1,14 @@ Guidelines for Approaching Code Tasks ## Initial Assessment Phase + - **Always seek clarification** on requirements before proceeding - **Ask targeted questions** to uncover unstated assumptions or edge cases - **Establish success criteria** - how will we know when the task is complete? - **Identify potential constraints** (performance, compatibility, security) ## Planning Phase + - **Analyze the existing codebase** and provide a clear understanding of relevant components - **Present an implementation strategy** with a step-by-step approach - **Break down complex tasks** into smaller, manageable units of work @@ -14,6 +16,7 @@ Guidelines for Approaching Code Tasks - **Identify potential risks** and discuss mitigation strategies ## Implementation Phase + - **Start with a minimal working foundation** that demonstrates core functionality - **Implement features incrementally**, validating each step before proceeding - **Keep changes focused** with a small surface area to simplify debugging @@ -21,13 +24,16 @@ Guidelines for Approaching Code Tasks - **Seek feedback** at logical checkpoints during implementation ## Refinement Phase + - **Review the implementation** against the original requirements - **Test edge cases** explicitly - **Optimize only after functionality is correct** and only where necessary - **Consider maintenance implications** of the implementation ## Rationale + This structured approach prevents several common issues: + - It avoids wasted effort implementing misunderstood requirements - It makes debugging simpler by isolating changes - It provides clear checkpoints for validation diff --git a/.rules/guidelines/javascript.md b/.rules/guidelines/javascript.md index c9b6bd731..4ed0cc187 100644 --- a/.rules/guidelines/javascript.md +++ b/.rules/guidelines/javascript.md @@ -22,3 +22,4 @@ project/ │ ├── index.spec.js │ └── utils.spec.js └── README.md +``` diff --git a/.rules/guidelines/svelte.md b/.rules/guidelines/svelte.md index 2d57e5905..eb6c66903 100644 --- a/.rules/guidelines/svelte.md +++ b/.rules/guidelines/svelte.md @@ -8,6 +8,7 @@ - E2E tests should follow the page object pattern ## Svelte 5 + {{[Svelte & Svelte Kit Distilled](https://svelte-llm.khromov.se/svelte-complete-distilled)}} {{[svelte 5 documentation](https://svelte.dev/docs/svelte/llms.txt)}} @@ -114,6 +115,7 @@ To pass a snippet to another component: {/snippet} ``` + Both of these options work in a similar way ### Important: What NOT to do diff --git a/.rules/llms.md b/.rules/llms.md index 04d6449e5..ab146decd 100644 --- a/.rules/llms.md +++ b/.rules/llms.md @@ -16,11 +16,10 @@ First, carefully review the following guidelines: {{[SVELTE_5_GUIDELINES](./guidelines/svelte.md)}} - - Now, follow these instructions to implement Svelte 5 components and structure the project: 1. Component Implementation: + - Use Svelte 5 runes mode for all component code. - Implement state management using $state, $derived, and $effect runes. - Use $props() for component properties. @@ -29,20 +28,24 @@ Now, follow these instructions to implement Svelte 5 components and structure th - Consider reduced motion in your implementations. 2. Project Structure: + - Use SvelteKit for the application structure. - Organize your project following the provided directory structure. - Use .svelte.js extension for files using runes in the source code. - Use .spec.svelte.js extension for test files using runes. 3. Styling: + - Use UnoCSS for all styling in the project. 4. Testing: + - Implement unit tests using vitest. - Implement end-to-end (e2e) tests using Playwright. - Follow the page object pattern for e2e tests. 5. Event Handling: + - Treat event handlers as properties in Svelte 5. - Use onclick instead of on:click for event binding. - Pass callback props to components instead of using event forwarding. @@ -54,6 +57,7 @@ Now, follow these instructions to implement Svelte 5 components and structure th When implementing components or structuring the project, provide your code inside tags. For explanations or comments, use tags. Your final output should include: + 1. A brief overview of the implemented components or project structure. 2. The actual implementation or structure in tags. 3. Explanations for your choices in tags. diff --git a/packages/chart/README.md b/packages/chart/README.md index 7a5bf139c..e63ea4133 100644 --- a/packages/chart/README.md +++ b/packages/chart/README.md @@ -18,7 +18,7 @@ The chart package provides a set of composable components that can be combined t