You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Convert extension to ESM and improve Prettier module loading
This PR converts the extension from CommonJS to ESM modules and improves
how Prettier is loaded and resolved.
Key changes:
**ESM Conversion**
- Convert all source files to use ESM imports/exports
- Update esbuild configuration for ESM output
- Add .js extensions to all relative imports
- Update tsconfig for ESM module resolution
**Prettier Module Loading**
- Lazy-load bundled Prettier using dynamic import() for faster activation
- Remove worker thread implementation (PrettierWorkerInstance) - now use
PrettierDynamicInstance which loads Prettier dynamically
- Improve plugin loading to resolve and import plugins as ES modules
- Add utility functions for finding modules (find-up, resolve-module-entry)
**Extension Activation**
- Make activate() async and await formatter registration
- Ensures formatters are ready when extension.isActive becomes true
- Fixes race condition where tests could run before formatters registered
**Test Infrastructure**
- Add ensureExtensionActivated() helper for reliable test setup
- Extract common format test utilities to formatTestUtils.ts
- Update test imports for ESM compatibility
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,7 @@
55
55
</p>
56
56
57
57
> [!IMPORTANT]
58
-
> **Extension Migration:** This extension is being moved from `esbenp.prettier-vscode` to [`prettier.prettier-vscode`](https://marketplace.visualstudio.com/items?itemName=prettier.prettier-vscode). Version 12+ is only published to the new for now as it is a major change. Once it is stable, we will publish v12 to both extensions and deprecate the `esbenp.prettier-vscode` extension. **Version 12.x is currently not stable, use with caution in production environments.**
58
+
> **Extension Migration:** This extension is being moved from `esbenp.prettier-vscode` to [`prettier.prettier-vscode`](https://marketplace.visualstudio.com/items?itemName=prettier.prettier-vscode). Version 12+ is only published to the new for now as it is a major change. Once it is stable, we will publish v12 to both extensions and deprecate the `esbenp.prettier-vscode` extension. **Version 12.x is currently not stable, use with caution and report bugs.**
0 commit comments