chore: replace prettier for oxfmt - #1235
Conversation
|
Install the latest version of pnpm add https://pkg.svelte.dev/sv/c/61cce4d3142d8f060237c694d100ab91ba6d25deOpen in |
|
| "format": "pnpm lint --write", | ||
| "lint": "prettier --check . --config ../../prettier.config.js --ignore-path ../../.gitignore --ignore-path ../../.prettierignore" |
There was a problem hiding this comment.
We don't format & lint at package level anymore? Only from root?
There was a problem hiding this comment.
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
| @@ -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'; | |||
There was a problem hiding this comment.
For these formating we used @trivago/prettier-plugin-sort-imports. There is not something equivalent yet?
There was a problem hiding this comment.
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
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.oxfmtuses 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
oxfmttrying 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