-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Open
Labels
Description
📜 Description
Prettier is used to format generated API reports. This code relies on the resolveConfig.sync
method in Prettier, which was removed in v3. This means the code hits the catch block and silently fails.
Note that even if we move away from using this method, the format
method itself in prettier has also moved to be async, so we'll likely need a deeper refactoring here if we want to support Prettier v3. It's not clear how we'd actually go about that though, since the curretn approach relies on patching a synchronous method. Perhaps one solution here is a feature request to api-extractor to add support for supplying a custom formatter.
👍 Expected behavior
- API report generation should succeed with both prettier v2 and v3
- When formatting fails, we should log an error to make debugging easier
👎 Actual Behavior with Screenshots
Report generation succeeds but files are not formatted.
👟 Reproduction steps
- Update to prettier v3
- Generate api-reports in any Backstage codebase
- Observe that the resulting files are not formatted.
📃 Provide the context for the Bug.
No response
🖥️ Your Environment
No response
👀 Have you spent some time to check if this bug has been raised before?
- I checked and didn't find similar issue
🏢 Have you read the Code of Conduct?
- I have read the Code of Conduct
Are you willing to submit PR?
None