mirror of
https://github.com/flarum/framework.git
synced 2024-11-25 17:57:04 +08:00
Add documentation
This commit is contained in:
parent
848dbc9ae8
commit
f6b4f2fbfb
|
@ -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,
|
||||
};
|
||||
```
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue
Block a user