bug(devkit): `formatFiles` uses prettier v3 async api in context with prettier v2 which causes intermittent pipeline failures within tests
Hotell opened this issue · 0 comments
Hotell commented
Current Behavior
- full context microsoft/fluentui#31408
- related PRs that didnt fix the issues
- TL;DR
formatFiles
uses async prettierformat
API- this is causing intermittent failures on CI within tests
- nx ships prettier v2 (v3 is a major blocker with jest for example )
Expected Behavior
formatFiles
should use API based on prettier versions, quick fix should be using synchronous API that exists within prettier v2 (which all nx workpsaces should be using).
If user has prettier v3 installed a fallback to @prettier/sync
should happen under the hood.
GitHub Repo
Steps to Reproduce
- check the issue and link to pipeline
Nx Report
Node : 18.20.1
OS : darwin-arm64
yarn : 1.23.34
nx : 17.3.2
@nx/js : 17.3.2
@nx/jest : 17.3.2
@nx/linter : 17.3.2
@nx/eslint : 17.3.2
@nx/workspace : 17.3.2
@nx/devkit : 17.3.2
@nx/eslint-plugin : 17.3.2
@nx/node : 17.3.2
@nx/plugin : 17.3.2
@nrwl/tao : 17.3.2
typescript : 4.7.4
---------------------------------------
Local workspace plugins:
@fluentui/workspace-plugin
Failure Logs
No response
Package Manager Version
yarn v1
Operating System
- macOS
- Linux
- Windows
- Other (Please specify)
Additional Information
Related issues #19519 cc @AgentEnder