Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global install is working! #416

Merged
merged 1 commit into from
May 12, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,23 +69,27 @@ array_map(

## Install

Currently, the plugin can only be installed locally, due to an [issue in Prettier's plugin system](https://github.com/prettier/prettier/issues/4000).
You'll need a current development version of prettier, because the plugin depends on currently unreleased features.

yarn:

```bash
yarn add --dev prettier/prettier prettier/plugin-php
# or globally
yarn global add prettier/prettier prettier/plugin-php
```

npm:

```bash
npm install --save-dev prettier/prettier prettier/plugin-php
# or globally
npm install --global prettier/prettier prettier/plugin-php
```

## Use

You can add Prettier as a script in your `package.json`,
If you installed prettier as a local dependency, you can add prettier as a script in your `package.json`,

```json
"scripts": {
Expand All @@ -101,16 +105,22 @@ yarn run prettier path/to/file.php --write
npm run prettier path/to/file.php --write
```

If you installed globally, run

```bash
prettier path/to/file.php --write
```

## Contributing

If you're interested in contributing to the development of Prettier for PHP, you can follow the [CONTRIBUTING guide from Prettier](https://github.com/prettier/prettier/blob/master/CONTRIBUTING.md), as it all applies to this repository too.

To test it out on a PHP file:

* Clone this repository.
* Run `yarn`.
* Create a file called `test.php`.
* Run `yarn prettier test.php` to check the output.
- Clone this repository.
- Run `yarn`.
- Create a file called `test.php`.
- Run `yarn prettier test.php` to check the output.

## Maintainers

Expand Down