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
- `experimentalSortImports` 👉🏻 `sortImports`
- `experimentalSortPackageJson` 👉🏻 `sortPackageJson`
- `experimentalTailwindcss` 👉🏻 `sortTailwindcss`
To avoid breaking changes, the old name is retained as an alias.
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.
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)