Skip to content

chore: replace prettier for oxfmt - #1235

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

chore: replace prettier for oxfmt#1235
AdrianGonz97 wants to merge 21 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 b678975:

pnx https://pkg.svelte.dev/sv/c/b678975ea2eecc8eb9530be9ef4b95b04a0e86b9 create

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: b678975

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 thread packages/sv/src/addons/experimental.ts Outdated
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

@E021ntox

Copy link
Copy Markdown

The community is really excited about the transition from Prettier to oxfmt. Please approve this PR as soon as possible, thanks!

@sacrosanctic

Copy link
Copy Markdown
Contributor

@E021ntox This is for the repo itself. It will be invisible to the users of the CLI.

@E021ntox

Copy link
Copy Markdown

Got it. But I wanted to let you know that users actually need oxlint and oxfmt more.

@jycouet

jycouet commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Got it. But I wanted to let you know that users actually need oxlint and oxfmt more.

Please, stop commenting non-stop on random things random stuff. We got your point.

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.

4 participants