https://github.com/dprint/dprint-plugin-mago
Adapter plugin to use Mago (PHP) in dprint's CLI and with JavaScript via Wasm
https://github.com/dprint/dprint-plugin-mago
Last synced: 3 months ago
JSON representation
Adapter plugin to use Mago (PHP) in dprint's CLI and with JavaScript via Wasm
- Host: GitHub
- URL: https://github.com/dprint/dprint-plugin-mago
- Owner: dprint
- License: other
- Created: 2025-12-31T17:04:38.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2026-02-24T15:13:28.000Z (5 months ago)
- Last Synced: 2026-02-24T19:54:36.193Z (5 months ago)
- Language: Rust
- Homepage:
- Size: 46.9 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dprint-plugin-mago
[](https://github.com/dprint/dprint-plugin-mago/actions?query=workflow%3ACI)
Adapter for [Mago](https://github.com/carthage-software/mago) for use as a formatting plugin in [dprint](https://github.com/dprint/dprint).
## Install
[Install](https://dprint.dev/install/) and [setup](https://dprint.dev/setup/) dprint.
Then in your project's directory with a dprint.json file, run:
```shellsession
dprint config add mago
```
Note: You do not need Mago installed globally as dprint will run Mago from the .wasm file in a sandboxed environment.
## Configuration
To add configuration, specify a `"mago"` key in your dprint.json:
```jsonc
{
"mago": {
"printWidth": 100,
"useTabs": true,
},
"plugins": [
// ...etc...
],
}
```
For an overview of the config, see https://dprint.dev/plugins/mago/config/
Note: The plugin does not understand Mago's configuration file because it runs sandboxed in a Wasm runtime—it has no access to the file system in order to read Mago's config.
## JS Formatting API
- [JS Formatter](https://github.com/dprint/js-formatter) - Browser/Deno and Node
- [npm package](https://www.npmjs.com/package/@dprint/mago)
## Versioning
This repo automatically upgrades to the latest version of Mago once a day. You can check which version of Mago is being used by looking at the `mago-formatter` entry in the Cargo.toml file in this repo:
https://github.com/dprint/dprint-plugin-mago/blob/main/Cargo.toml
At the moment, the version of this plugin does not reflect the version of Mago. This is just in case there are any small bug fixes that need to be made as this plugin is quite new. After a while I'll try to match the versions.