Skip to content

chore: replace prettier for oxfmt - #1235

Open
AdrianGonz97 wants to merge 16 commits into
version-1from
chore/migrate-to-oxfmt
Open

chore: replace prettier for oxfmt#1235
AdrianGonz97 wants to merge 16 commits into
version-1from
chore/migrate-to-oxfmt

Conversation

@AdrianGonz97

Copy link
Copy Markdown
Member

Description

Most files should stay the same with perhaps a minor formatting difference in some.

A notable change is the difference in field sorting for the package.jsons. oxfmt uses it's own sorting algorithm that's not very customizable at the moment, but it still works pretty well out of the box.

I also had to change the add-on template's package name placeholder to a slightly different variation due to oxfmt trying to format ~SV-PROTOCOL-NAME-TODO~ into ~~SV-PROTOCOL-NAME-TODO~~ in markdown files. The new placeholder name is now: $SV-PROTOCOL-NAME-TODO$.

Checklist

  • Update snapshots (if applicable)
  • Add a changeset (if applicable)
  • Allow maintainers to edit this PR
  • I care about what I'm doing, no matter the tool I use (Notepad, Sublime, VSCode, AI...)

@pkg-svelte-dev

pkg-svelte-dev Bot commented Aug 7, 2026

Copy link
Copy Markdown

Install the latest version of sv from 61cce4d:

pnpm add https://pkg.svelte.dev/sv/c/61cce4d3142d8f060237c694d100ab91ba6d25de

Open in pkg.svelte.dev: https://pkg.svelte.dev/repos/cli/pr/1235

@changeset-bot

changeset-bot Bot commented Aug 7, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 61cce4d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@svelte-docs-bot

Copy link
Copy Markdown

@AdrianGonz97
AdrianGonz97 marked this pull request as draft August 7, 2026 22:40
@AdrianGonz97
AdrianGonz97 marked this pull request as ready for review August 8, 2026 04:57
Comment on lines -15 to -16
"format": "pnpm lint --write",
"lint": "prettier --check . --config ../../prettier.config.js --ignore-path ../../.gitignore --ignore-path ../../.prettierignore"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We don't format & lint at package level anymore? Only from root?

@AdrianGonz97 AdrianGonz97 Aug 8, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

correct! if you're cd'd into a specific package, you can just run pnpm -w format to run the format script from a sub package. same goes for linting

Comment on lines 1 to 13
@@ -8,8 +10,6 @@ import {
svelteConfig,
transforms
} from '@sveltejs/sv-utils';
import fs from 'node:fs';
import path from 'node:path';
import { defineAddon, defineAddonOptions } from '../core/config.ts';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For these formating we used @trivago/prettier-plugin-sort-imports. There is not something equivalent yet?

@AdrianGonz97 AdrianGonz97 Aug 8, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

it does support import supporting, but the default sorting algo is slightly different. by default, imports for native node api's are sorted to the top of the list

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