nrwl/nx

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

Current Behavior

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

microsoft/fluentui#31408

Steps to Reproduce

  1. 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