Skip to content
Merged
Show file tree
Hide file tree
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
56 changes: 41 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,37 +34,63 @@

## WORK IN PROGRESS

Please note that this plugin is under active development, and might not be ready to run on production code yet.

## 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.
Please note that this plugin is currently in alpha stage and still under active development. We encourage everyone to try it and give feedback, but we don't recommend it for production use yet.

## Install

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
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
npm install --save-dev prettier/prettier @prettier/plugin-php
# or globally
npm install --global prettier/prettier @prettier/plugin-php
```

## Use

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

```json
"scripts": {
"prettier": "prettier"
}
```

and then run it via

```bash
yarn run prettier path/to/file.php --write
# or
npm run prettier path/to/file.php --write
```

If you installed globally, run

```bash
prettier --write "**/*.php"
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.

## Maintainers

<table>
Expand Down
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
{
"name": "@prettier/plugin-php",
"version": "0.0.0-development",
"version": "0.1.0",
"description": "Prettier PHP Plugin",
"repository": "prettier/prettier-php",
"author": "Lucas Azzola <@azz>",
"license": "MIT",
"main": "src",
"files": ["src"],
"files": [
"src"
],
"dependencies": {
"php-parser": "glayzzle/php-parser#a8f10d8c9aacf8e90b283229f8bed76363b99fcf"
},
Expand All @@ -28,6 +30,8 @@
"prettier": "prettier --plugin=. --parser=php"
},
"jest": {
"projects": ["<rootDir>/jest.*.config.js"]
"projects": [
"<rootDir>/jest.*.config.js"
]
}
}