Skip to content

chore: format more files with dprint #777

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

Merged
merged 1 commit into from
Jul 18, 2025

Conversation

g-plane
Copy link
Contributor

@g-plane g-plane commented Jul 18, 2025

Summary by CodeRabbit

  • Style

    • Improved code and template formatting across multiple files for consistent indentation, spacing, and attribute usage.
    • Standardized self-closing tags, attribute quotes, and import statement ordering in Vue components.
    • Reformatted CSS for uniform indentation and readability.
    • Enhanced style sections with new or reorganized rules in select components.
  • Chores

    • Updated configuration files for formatting tools and workflows to ensure consistent code style.
    • Corrected YAML and JSON formatting in configuration files.
    • Added missing newline characters at the end of various files.

Copy link

coderabbitai bot commented Jul 18, 2025

Walkthrough

This update applies consistent code style and formatting improvements across the project. Changes include reordering import statements, normalizing whitespace and indentation, adjusting tag self-closing syntax, and updating string delimiters in templates and styles. Several configuration files are updated to centralize formatting rules and correct YAML structure. No logic, functionality, or exported entities are altered.

Changes

File(s) Change Summary
.github/workflows/gh-pages.yml, .pre-commit-config.yaml, dprint.json, package.json Whitespace, indentation, and formatting corrections in workflow, pre-commit, formatter, and package config files.
website/.vitepress/theme/custom.css, website/src/style.css Indentation and whitespace normalization in CSS files.
website/src/App.vue, website/src/BlogIndex.vue, website/src/Homepage.vue Import reordering, template formatting, and added trailing newlines.
website/src/catalog/.vue, website/src/cheatsheet/.vue, website/src/components/*.vue Import reordering, template and style formatting, consistent tag syntax, and whitespace adjustments.
website/src/components/editors/.vue, website/src/components/utils/.vue Import consolidation, template and style formatting, improved attribute and slot tag consistency.
website/src/homepage/*.vue Template attribute delimiter normalization, tag self-closing consistency, and CSS reformatting.
website/src/icons/Reset.vue SVG attribute reformatting and added trailing newline.

Poem

A rabbit hopped through fields of code,
Tidying tags where whitespace showed.
Imports lined up, indents just right,
Quotes and slashes shining bright.
No logic changed, just style anew—
The garden’s neat, the carrots grew!
🥕✨


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (13)
.pre-commit-config.yaml (1)

2-8: YAML list indentation is now valid, but consider pinning by commit

The added dashes/indent fix the structure so pre-commit can parse the hooks.
For reproducibility, you may also want to pin rev to an exact commit SHA instead of the moving v1.0 tag (same advice for any future repos).

website/src/components/utils/Toast.vue (1)

10-10: Import-order change is fine, but any weakens type safety

Pure formatting on this line is fine. Still, storing ComponentInternalInstance | null in an any and mutating it later bypasses TS checks. Consider:

-let instance: any
+import type { ComponentInternalInstance } from 'vue'
+let instance: ComponentInternalInstance | null = null

and gate instance?.proxy?.show to avoid potential runtime undefined access.

website/src/components/PatternEditor.vue (1)

52-58: Type-annotate the Monaco cursor event instead of any.

changeFocusNode receives Monaco’s ICursorPositionChangedEvent, so we can remove the any escape hatch and get proper intellisense / compile-time checks.

-import type { EditorWithPanel, Monaco } from './editors'
+import type { EditorWithPanel, Monaco } from './editors'
+import type { ICursorPositionChangedEvent } from 'monaco-editor'   // ← add

-function changeFocusNode(e: any) {
-  const { position } = e
+function changeFocusNode(e: ICursorPositionChangedEvent) {
+  const { position } = e
   cursorPosition.value = {
     row: position.lineNumber - 1,
     column: position.column - 1,
   }
 }

Tiny but worthwhile cleanup; no functional impact.

website/src/components/Toolbars.vue (1)

24-26: Add an accessible label to the Share icon.

Screen-reader users get no information from a naked SVG. A quick fix is aria-label or title.

-      <Share style="width: 24px; height: 24px" />
+      <Share style="width: 24px; height: 24px" aria-label="Share URL icon" />
website/src/components/QueryEditor.vue (1)

45-51: Swap any for Monaco’s cursor event type.

Same reasoning as in PatternEditor.vue—type information is available, let’s use it.

-import { EditorWithPanel, Monaco } from './editors'
+import { EditorWithPanel, Monaco } from './editors'
+import type { ICursorPositionChangedEvent } from 'monaco-editor'

-function changeFocusNode(e: any) {
+function changeFocusNode(e: ICursorPositionChangedEvent) {
   const { position } = e
   cursorPosition.value = {
     row: position.lineNumber - 1,
     column: position.column - 1,
   }
 }
website/src/components/editors/Diff.vue (1)

56-58: Minor: inline object literal fits on one line now.

Pure style, but reduces diff noise in future edits:

-  editor.value?.setModel({
-    original,
-    modified,
-  })
+  editor.value?.setModel({ original, modified })

Feel free to ignore—only a readability tweak.

website/src/components/SelectLang.vue (1)

29-33: Consider adding a :key on the <option> inside the v-for.

Even though the parent <label> isn’t used here, Vue still benefits from a key for stable updates:

       v-for="(val, key) in languageDisplayNames"
       :value="key"
+      :key="key"
website/src/components/editors/Monaco.vue (1)

76-87: Trailing comma & wrapping only – no logic change.

One optional optimisation: emitting on every keystroke can be heavy; consider debouncing if performance ever becomes an issue.

website/src/homepage/Ecosystem.vue (1)

7-48: Add alt text and rel="noopener noreferrer" for accessibility & security

All <img> tags are decorative logos but still require an alt attribute (use alt="" if purely decorative).
Every external <a> using target="_blank" should also include rel="noopener noreferrer" to mitigate tab-nabbing.

-<a target="_blank" href="https://swc.rs" title="SWC" class="sponsor">
-  <img src="https://avatars.githubusercontent.com/u/26715726?s=200&v=4" />
+<a
+  target="_blank"
+  rel="noopener noreferrer"
+  href="https://swc.rs"
+  title="SWC"
+  class="sponsor"
+>
+  <img src="https://avatars.githubusercontent.com/u/26715726?s=200&v=4" alt="SWC logo" />

Please replicate for the remaining anchors/images in this block.

website/src/catalog/RuleList.vue (1)

55-59: Empty href causes unwanted page-reload

<a href="" @click="emit('reset')"> navigates to the current page before Vue catches the click, creating a quick flash / scroll reset.
Use href="#" with prevent, or convert to a <button>.

-You can <a href="" @click="emit('reset')">reset the filter</a> to discover all rules.
+You can
+<button type="button" class="link-like" @click.prevent="emit('reset')">
+  reset the filter
+</button>
+to discover all rules.
website/src/catalog/RuleItem.vue (1)

51-52: Missing alt attribute on logo image

Add an empty or descriptive alt so assistive technologies don’t announce the file name.

-<img class="logo" :src="'/langs/' + meta.language.toLowerCase() + '.svg'" />
+<img
+  class="logo"
+  :src="'/langs/' + meta.language.toLowerCase() + '.svg'"
+  :alt="meta.language + ' logo'"
+/>
website/src/components/EnvDisplay.vue (1)

137-139: Nit: stray utility <div class="choose-match-division" />

A self-closing <div /> is valid in Vue but semantically odd (it renders nothing).
Confirm if it’s a leftover spacer; otherwise remove or replace with CSS margin.

website/src/homepage/Features.vue (1)

54-56: (Nit) <hr> outside <li> is invalid HTML list content.

A <ul> is only allowed to contain <li> (plus script/template).
The trailing <hr /> should either be moved into a wrapping element
or removed.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5b84156 and 0d000ed.

📒 Files selected for processing (39)
  • .github/workflows/gh-pages.yml (3 hunks)
  • .pre-commit-config.yaml (1 hunks)
  • dprint.json (3 hunks)
  • package.json (1 hunks)
  • website/.vitepress/theme/custom.css (1 hunks)
  • website/src/App.vue (3 hunks)
  • website/src/BlogIndex.vue (2 hunks)
  • website/src/Homepage.vue (2 hunks)
  • website/src/catalog/Option.vue (1 hunks)
  • website/src/catalog/RuleFilter.vue (5 hunks)
  • website/src/catalog/RuleItem.vue (5 hunks)
  • website/src/catalog/RuleList.vue (4 hunks)
  • website/src/catalog/index.vue (2 hunks)
  • website/src/cheatsheet/Item.vue (2 hunks)
  • website/src/cheatsheet/SheetTable.vue (2 hunks)
  • website/src/components/EnvDisplay.vue (5 hunks)
  • website/src/components/Intro.vue (3 hunks)
  • website/src/components/PatternConfig.vue (2 hunks)
  • website/src/components/PatternEditor.vue (4 hunks)
  • website/src/components/Playground.vue (4 hunks)
  • website/src/components/QueryEditor.vue (7 hunks)
  • website/src/components/ResetConfig.vue (1 hunks)
  • website/src/components/SelectLang.vue (3 hunks)
  • website/src/components/Toolbars.vue (3 hunks)
  • website/src/components/dump/GeneralNode.vue (4 hunks)
  • website/src/components/dump/PatternNode.vue (4 hunks)
  • website/src/components/dump/TreeNode.vue (5 hunks)
  • website/src/components/editors/Diff.vue (7 hunks)
  • website/src/components/editors/EditorWithPanel.vue (2 hunks)
  • website/src/components/editors/Monaco.vue (6 hunks)
  • website/src/components/utils/Error.vue (2 hunks)
  • website/src/components/utils/IconDown.vue (2 hunks)
  • website/src/components/utils/Tabs.vue (3 hunks)
  • website/src/components/utils/Toast.vue (4 hunks)
  • website/src/homepage/Ecosystem.vue (1 hunks)
  • website/src/homepage/Features.vue (1 hunks)
  • website/src/homepage/Languages.vue (1 hunks)
  • website/src/icons/Reset.vue (1 hunks)
  • website/src/style.css (3 hunks)
🔇 Additional comments (60)
package.json (1)

38-38: Trailing newline added – 👍

Adding a final newline keeps the file POSIX-compliant and aligns with dprint’s style rules.

website/src/components/ResetConfig.vue (1)

30-30: Consistent EOF newline – looks good

Keeps the Vue component formatting consistent across the repo.

website/src/catalog/Option.vue (1)

32-32: EOF newline inserted – approved

Matches the formatter’s expectations; no functional impact.

website/.vitepress/theme/custom.css (1)

16-16: Whitespace cleanup – approved

Removing the stray blank line and adding a terminating newline improves cleanliness without affecting styles.

website/src/components/utils/Error.vue (1)

18-18: Interpolations spaced & newline added – good

Spacing around prettyError interpolation boosts readability, and the trailing newline keeps formatting uniform.

Also applies to: 35-35

website/src/components/utils/IconDown.vue (1)

2-2: Self-closing tag spacing and trailing newline look good

Consistent self-closing syntax and EOF newline align with the repo’s dprint rules; no functional impact observed.

Also applies to: 15-15

website/src/components/utils/Toast.vue (1)

33-33: Template spacing & CSS formatting only — looks good

Interpolation spacing and box-shadow whitespace tweaks have no runtime effect and improve readability.

Also applies to: 51-51

website/src/style.css (1)

10-12: Whitespace-only changes — no issues

Indent reduction to two spaces is consistent with the rest of the stylesheet. No semantic CSS alterations detected.

Also applies to: 19-20, 24-25, 29-30, 34-35, 39-40, 44-45, 53-54, 58-60, 70-71, 77-82, 86-87, 172-172

website/src/icons/Reset.vue (1)

3-9: Attribute re-formatting improves readability

Splitting long SVG attributes over multiple lines is purely stylistic; markup remains identical.

Also applies to: 14-14

website/src/cheatsheet/Item.vue (1)

10-14: Consistent self-closing tag spacing looks good

The added space before the / aligns with the new dprint rules and keeps the template uniform.

website/src/cheatsheet/SheetTable.vue (1)

5-10: Formatting changes are correct and harmless

Trailing commas, whitespace inside mustaches, and the spaced <slot /> all match the updated formatter settings without affecting behaviour.

Also applies to: 18-22

website/src/BlogIndex.vue (1)

14-19: Inline interpolations—no functional impact

Condensing the mustache expressions is purely stylistic; rendering is unchanged.

website/src/catalog/index.vue (1)

3-5: Import re-ordering and tag spacing look fine

The reordered imports improve readability, and the spaced self-closing tag is consistent with the rest of the PR.

Also applies to: 13-14, 37-38

website/src/components/editors/EditorWithPanel.vue (1)

8-10: Minor: generic defineEmits signature is fine

Removal of the trailing comma is stylistic; type safety remains intact.

.github/workflows/gh-pages.yml (1)

19-21: Pin wasm-pack to a fixed version for deterministic CI

Using "latest" makes your build depend on whatever is published next, risking unexpected breakages and non-reproducible artifacts. Replace it with the exact version you’ve tested locally.

• File: .github/workflows/gh-pages.yml
• Lines: 19–21

Suggested diff:

-          # Optional version of wasm-pack to install(eg. 'v0.9.1', 'latest')
-          version: "latest"
+          # Pin to a known-good version; update intentionally.
+          version: "<PINNED_WASM_PACK_VERSION>"

Please confirm and replace <PINNED_WASM_PACK_VERSION> with the exact wasm-pack version you’re already using.

website/src/homepage/Languages.vue (3)

8-30: LGTM! Consistent self-closing tag formatting.

The spacing before self-closing slashes in <img> tags improves readability and follows standard HTML formatting conventions.


34-34: LGTM! Text formatting improvement.

Merging the text onto one line improves source code readability without affecting the rendered output.


41-83: LGTM! CSS formatting consistency improved.

The CSS block has been properly indented and formatted, enhancing readability and maintainability without altering any style rules.

website/src/components/dump/GeneralNode.vue (5)

9-9: LGTM! Trailing comma added for consistency.

Adding a trailing comma in the props definition follows JavaScript/TypeScript best practices and makes future additions cleaner.


26-35: LGTM! Template formatting improvements.

The spacing adjustments in class bindings and self-closing tags improve readability and maintain consistent formatting across the template.


41-56: LGTM! CSS variable formatting consistency.

The CSS variable declarations have been properly formatted with consistent spacing, improving readability of the style definitions.


65-65: LGTM! CSS transition duration clarified.

The transition duration value has been properly formatted for better readability.


93-93: LGTM! File ending consistency.

Adding a newline at the end of the file follows standard formatting conventions.

website/src/App.vue (3)

2-2: LGTM! Import statement organization.

Reordering the imports improves code organization and readability.


34-59: LGTM! Template formatting improvements.

The self-closing component tags now have proper spacing, and the SVG markup has been reformatted for better readability while maintaining the same structure and functionality.


142-142: LGTM! File ending consistency.

Adding a newline at the end of the file follows standard formatting conventions.

website/src/components/dump/TreeNode.vue (4)

3-5: LGTM! Import statement organization.

The import statements have been properly organized and formatted for better readability.


15-15: LGTM! Trailing comma consistency.

Adding a trailing comma in the props definition follows JavaScript/TypeScript best practices.


53-67: LGTM! Template formatting improvements.

The multiline component tag format and spacing improvements in template interpolations enhance readability without affecting functionality.


114-114: LGTM! File ending consistency.

Adding a newline at the end of the file follows standard formatting conventions.

website/src/components/PatternConfig.vue (4)

25-25: LGTM! Self-closing tag formatting.

Adding a space before the self-closing slash follows standard HTML formatting conventions.


28-31: LGTM! Multiline anchor tag formatting.

Reformatting the anchor tag to multiline with each attribute on its own line improves readability, especially for longer URLs.


33-33: LGTM! Input element formatting consistency.

The input element now follows the same self-closing tag formatting convention with a space before the slash.


67-67: LGTM! File ending consistency.

Adding a newline at the end of the file follows standard formatting conventions.

website/src/Homepage.vue (2)

2-7: Imports reordered only – no functional impact.

Re-ordering looks consistent with the new dprint rules; no runtime effect.
LGTM.


38-38: Trailing newline added – OK.

No objections to the stylistic change.

website/src/components/Intro.vue (3)

8-27: Template formatting changes look correct.

Only whitespace / tag-closing fixes.
No behavioural change – all good.


47-48: Font-family string delimiter switched to single quotes – OK.

CSS still parses the same; style consistency improved.


58-58: Newline at EOF – fine.

website/src/components/SelectLang.vue (4)

2-3: Imports moved to the top – good for clarity.


24-25: Minor text-only change – no issues.


35-35: Self-closing component formatted – OK.


61-61: Newline at EOF – fine.

website/src/catalog/RuleFilter.vue (7)

2-3: Flattened import list improves readability – looks good.


28-32: Template tweak only – nothing to flag.


38-40: Loop destructuring parentheses are correct.


43-43: Component tag self-closed – fine.


52-52: Same minor formatting – OK.


67-67: Same as above – no functional change.


146-146: Whitespace tweak inside keyframes – harmless.

website/src/components/editors/Monaco.vue (6)

11-13: Grouped imports – consistent with rest of repo.


22-23: Event typings split across lines – readability win.


44-44: Variable renamed to editor with explicit type – OK.


108-115: Indent / wrapping changes in helper – fine.


125-126: Same for match decoration – looks good.


184-184: Self-closing <div /> formatted – no issues.

website/src/components/Playground.vue (2)

82-87: Minor: PatternEditor prop order looks inconsistent

Optional—but keeping language before ruleErrors (or vice-versa) across components helps quick scanning.

No action needed if you prefer current ordering.


64-68: Nice spacing clean-up—LGTM

The added space before /> on self-closing components improves consistency.

dprint.json (1)

47-54: Confirm external plugin URLs are resolvable before merging.

The three new plugins are fetched from plugins.dprint.dev/g-plane/*.
If any of these exact version URLs 404, CI formatting jobs will fail.

Consider running a quick CURL check or pinning to the tag latest until the
artifact is published.

website/src/components/dump/PatternNode.vue (1)

68-96: LGTM – purely cosmetic changes keep existing behaviour intact.

Only whitespace / attribute-order tweaks were introduced; no reactive logic was touched.

@HerringtonDarkholme HerringtonDarkholme added this pull request to the merge queue Jul 18, 2025
Merged via the queue into ast-grep:main with commit f46f85f Jul 18, 2025
1 check passed
@g-plane g-plane deleted the more-dprint-plugins branch July 18, 2025 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants