Commit Graph

12 Commits

Author SHA1 Message Date
Boshen 1193c9dbaf chore(oxfmt): dogfood operator position at line start (#25937)
dogfood
2026-08-20 14:36:47 +00:00
leaysgur c07fe7c217 feat(oxfmt): support experimentalOperatorPosition (#25643)
Fixes #16366

---

Option name requires `experimental` prefix for now.

Values are:

- `"start"`
- `"end"`(default)

This is also available on playground.
2026-08-14 08:12:16 +00:00
leaysgur ea5d09534d fix(oxfmt): update --migrate prettier (#23963)
A bit outdated, updated it to reflect the latest situation.

- Support `svelte` migration
- Better (but not yet complete) `overrides` detection
- Remove warning about `embeddedLanguageFormatting` (already supported)
- etc
2026-06-30 00:59:07 +00:00
leaysgur 984dc07f4f feat(oxfmt): Strip "experimental"SortXxx prefix (#19567)
- `experimentalSortImports` 👉🏻 `sortImports`
- `experimentalSortPackageJson` 👉🏻 `sortPackageJson`
- `experimentalTailwindcss` 👉🏻 `sortTailwindcss`

To avoid breaking changes, the old name is retained as an alias.
2026-02-20 08:56:22 +00:00
leaysgur e754b18dca fix(oxfmt/migrate-prettier): Set experimentalSortPackagejson: false by default (#18831)
Fixes #18741
2026-02-02 01:52:22 +00:00
leaysgur 77b23c9d18 refactor(oxfmt/migrate-biome): Borrow tiny-jsonc implementation (#18684)
Follow up on #18638

Replace JSONC parse logic with `tiny-jsonc`.
2026-01-29 08:18:40 +00:00
Luca Fischer ee30de98cf feat(oxfmt): add config migration from biome (#18638)
Added Biome-to-oxfmt configuration migration, based on the Prettier
implementation.

I wasn't sure if I should exclude settings that match oxfmt's defaults
from the generated config, but I'm happy to do so if you’d like
2026-01-28 21:09:13 +09:00
leaysgur d96ca05c81 refactor(oxfmt): Move tailwind option mapping to Rust (#18281)
Follow up on #17648

Move the `experimentalTailwindcss` to `tailwindXxx` option mapping logic from JS to Rust side (`populate_prettier_config`).

Now, consolidate all Prettier option processing in one place (`populate_prettier_config`).
This may also slightly improve performance by reducing JS runtime overhead a bit.
2026-01-20 08:58:36 +00:00
leaysgur 9a5e3e2b20 chore(oxfmt): Add comments for migrate overrides (#18216)
Please refer to #18215 for details.
2026-01-19 10:46:25 +00:00
Dunqing a680d99a38 feat(formatter): support migration of prettier-plugin-tailwindcss in --migrate:prettier (#17652)
This PR adds support for migrating `prettier-plugin-tailwindcss` configuration when running `oxfmt --migrate prettier`.

### Example

Prettier config (input):
```json
  {
    "plugins": ["prettier-plugin-tailwindcss"],
    "tailwindConfig": "./tailwind.config.js",
    "tailwindFunctions": ["clsx", "cn"],
    "tailwindAttributes": ["myClass"],
    "tailwindPreserveWhitespace": true
  }
```
 Oxfmt config (output):
```json
  {
    "printWidth": 80,
    "experimentalTailwindcss": {
      "config": "./tailwind.config.js",
      "functions": ["clsx", "cn"],
      "attributes": ["myClass"],
      "preserveWhitespace": true
    },
    "ignorePatterns": []
  }
```

### Notes
  - If the plugin is listed but no Tailwind options are specified, `experimentalTailwindcss` will be set to an empty object `{}` to enable the feature
  - Tailwind options without the plugin in the plugins array will NOT be migrated (they are skipped)
2026-01-05 12:10:06 +00:00
leaysgur 8fd4ea905a feat(oxfmt): options.embeddedLanguageFormatting is now "auto" by default (#17649)
Fixes #16763
2026-01-05 05:15:17 +00:00
leaysgur b4e8605a4d refactor(oxfmt): Clean up src-js files and directories (#17040)
```
.
├── bindings.d.ts
├── bindings.js
├── cli
│   ├── migration
│   │   ├── init.ts
│   │   ├── migrate-prettier.ts
│   │   └── shared.ts
│   └── worker-proxy.ts
├── cli-worker.ts    # CLI worker endpoint
├── cli.ts           # CLI endpoint
├── index.ts         # API endpoint
└── libs
    └── prettier.ts  # Core logic shared by index, cli-worker, cli/worker-proxy
```

By doing this, Node.js API `format()` does not use `worker_threads` anymore.
2025-12-18 10:44:28 +00:00