Repository navigation
chore: migrate from Prettier to oxfmt for code formatting - #11824
Conversation
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
✅ [V2]
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Great Idea. Was searching for something like this. |
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
|
@yangshun let me know if you want to update this PR. Now that we upgraded node it should pass CI. |
|
Sorry I dropped the ball on this, I'll update this PR within the next few days. Or if you want to take over go ahead as well. |
Replace prettier invocation in per-package build scripts and refresh yarn.lock after switching from prettier to oxfmt.
|
@slorber updated to latest Oxlint and rebased against
|
|
Thanks I'll test a bit the Oxc plugin for Intellij soon to see if this isn't disruptive for me, and merge asap 👍 |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
slorber
left a comment
There was a problem hiding this comment.
LGTM 👍
Additional notes:
- Removed the prettier xml plugin
- Kept https://github.com/prettier/stylelint-config-prettier, also works to avoid css conflicts with oxfmt, but we'll likely be able to remove it after upgrading Stylelint
// oxfmt-ignoreexists but do not work everywhere. For now, it's safer to use// prettier-ignore, also supported (see oxc-project/website#1092)- Removed
--no-error-on-unmatched-patternbecause otherwise it hides a bug: theme JS files are not pretty when swizzling them as JS. We want to ensure they remain formatted after the migration.
Otherwise it looks good and fast 👍
| "types": "src/plugin-ideal-image.d.ts", | ||
| "scripts": { | ||
| "build": "tsc --build && node ../../admin/scripts/copyUntypedFiles.js && prettier --config ../../.prettierrc --write \"lib/theme/**/*.js\"", | ||
| "build": "tsc --build && node ../../admin/scripts/copyUntypedFiles.js && oxfmt \"lib/theme/**/*.js\"", |
There was a problem hiding this comment.
FYI I removed the --no-error-on-unmatched-pattern on purpose
lib files are usually generated/ignored, but for lib/theme we definitely want to format them well because it's what users will get when swizzling with JS. (for TS we swizzle from source so it's already formatted)
| "packages/docusaurus-*/lib/*", | ||
|
|
||
| "packages/create-docusaurus/lib/*", | ||
| "!packages/docusaurus-*/lib/theme/**", |
There was a problem hiding this comment.
Needed to format js files for js swizzle CLI, otherwise we get an error without --no-error-on-unmatched-pattern because oxfmt doesn't format them
…2650) Add the Prettier to oxfmt migration (#11824), the 2019 Prettier run on Markdown files (#2102) and a 2018 CRLF to LF line endings fix. Co-authored-by: Claude Opus 5.5 <[email protected]>
* chore: remove tooling config entries for paths that no longer exist (AI-assisted) - jest/vendor (cspell, stylelint, oxfmt): removed with the Vitest migration, #12010 - packages/create-docusaurus/templates/facebook (ESLint): removed in #9026 - website/docusaurus.config.js (oxfmt): the config is TypeScript since #9317 - packages/docusaurus-migrate/lib (Vitest): package removed in #9400 - website/netlifyDeployPreview (.gitignore): removed in #4447 - .cache-loader (.gitignore): cache-loader removed with Webpack 5, #4089 - commented-out website/i18n/fr negations (.gitignore) - ".svg" (oxfmt): typo for the "*.svg" pattern right below it Co-Authored-By: Claude Opus 5.5 <[email protected]> * chore(knip): treat configuration hints as errors, ignore the ideal-image fork internals (AI-assisted) - Add treatConfigHintsAsErrors, and remove the 3 entries Knip reports as useless: the playwright binary, and the @docusaurus/plugin-css-cascade-layers and @mdx-js/react dependencies - Don't treat the react-ideal-image fork modules as theme component entries, so that Knip reports the unused ones Co-Authored-By: Claude Opus 5.5 <[email protected]> * test: remove unused test fixtures (AI-assisted) - docs bad-id-site and bad-slug-on-doc-home-site: unused since #3245 - utils vcs simple-site: unused since #11512 Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(website): fix the React-DOM version check of the bad package dogfood test (AI-assisted) The second check tested ReactVersion again, so a bad React-DOM version never threw. Introduced in #10391. Co-Authored-By: Claude Opus 5.5 <[email protected]> * chore: remove more stale config entries (AI-assisted) - .gitignore types: nothing generates a types dir, even in #1490 where it was added, and it ignores any new types/ source folder - .gitignore website/rspack-tracing.json: the Rspack trace is written to rspack-tracing.pftrace since #11290 - clear script --ignore docusaurus: protected the lib/ sources of the v1 "docusaurus" package, removed in #4902 - ESLint __mocks__ ignore: converted from .eslintignore in #12024, it only matches a root __mocks__ dir that doesn't exist - Syncpack type-alias group: only the exact @types/react version still needs it, the * ranges are gone since #12435 and the other dependencies use the catalog since #12696 Co-Authored-By: Claude Opus 5.5 <[email protected]> * chore: replace the Prettier and Jest leftovers (AI-assisted) The monorepo formats with oxfmt since #11824 and tests with Vitest since #12010 - Devcontainer: format with the Oxc extension instead of Prettier, which formatted with its defaults, and remove the Jest extension - README: remove the Prettier and Jest badges - CONTRIBUTING: the formatter is oxfmt Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
Summary
.oxfmtrc.jsonconfiguration and remove.prettierrc/.prettierignoreTest plan
oxfmtformats all files correctlyNotes on CI
pull-requests: writeto post the sticky comment); the audit itself ran successfully.