Add documentation

This commit is contained in:
David 2021-07-18 21:31:11 +01:00
parent 848dbc9ae8
commit f6b4f2fbfb
2 changed files with 29 additions and 1 deletions

View File

@ -1,3 +1,31 @@
# Flarum Prettier Config
Flarum's official configuration for the Prettier code formatter.
For more info about shared Prettier configurations, [check out the Prettier documentation](https://prettier.io/docs/en/configuration.html#sharing-configurations).
## Usage
Add the `prettier` key to your `package.json`:
```jsonc
// package.json
{
"name": "my-cool-package",
"version": "1.0.0",
"prettier": "@flarum/prettier-config"
// ...
}
```
## Extending
You can extend our config with your own custom options, too. Import our config, then spread its require in a `.prettierrc.js` file:
```js
// .prettierrc.js
module.exports = {
...require("@flarum/prettier-config"),
semi: false,
};
```

View File

@ -1,7 +1,7 @@
{
"name": "@flarum/prettier-config",
"version": "1.0.0",
"description": "",
"description": "Flarum's configuration for the Prettier code formatter.",
"main": "prettierrc.json",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"