Skip to content

Commit

Permalink
Add prettier-config package (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
stormwarning authored Feb 8, 2024
1 parent 3b5a863 commit d68405a
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 39 deletions.
5 changes: 5 additions & 0 deletions .changeset/chilled-comics-exist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@zazen/prettier-config": major
---

**Initial release 🎉**
21 changes: 2 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,15 @@
],
"package.json": "prettier --write"
},
"prettier": {
"plugins": [
"prettier-plugin-packagejson"
],
"semi": false,
"singleQuote": true,
"overrides": [
{
"files": [
"*.ts",
"*.tsx"
],
"options": {
"printWidth": 100
}
}
]
},
"prettier": "@zazen/prettier-config",
"devDependencies": {
"@changesets/cli": "2.27.1",
"@zazen/eslint-config": "workspace:*",
"@zazen/prettier-config": "workspace:*",
"eslint": "8.56.0",
"husky": "8.0.3",
"lint-staged": "15.2.0",
"prettier": "3.2.4",
"prettier-plugin-packagejson": "2.4.9",
"typescript": "5.3.3",
"vite": "5.0.12",
"vitest": "1.2.1"
Expand Down
15 changes: 15 additions & 0 deletions packages/prettier-config/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ISC License

Copyright Jeff Nelson

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
28 changes: 28 additions & 0 deletions packages/prettier-config/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# @zazen/prettier-config

## Usage

```shell
npm install --save-dev prettier @zazen/prettier-config
```

Add the following to your `package.json`:

```json
"prettier": "@zazen/prettier-config",
```

To extend the configuration, create `prettier.config.js` and spread this config
onto your own config object:

```js
import zazenConfig from '@zazen/prettier-config'

/** @type {import('prettier').Config} */
const config = {
...zazenConfig,
experimentalTernaries: true,
}

export default config
```
16 changes: 16 additions & 0 deletions packages/prettier-config/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/** @type {import('prettier').Config} */
const config = {
plugins: ['prettier-plugin-packagejson'],
semi: false,
singleQuote: true,
overrides: [
{
files: ['*.ts', '*.tsx'],
options: {
printWidth: 100,
},
},
],
}

export default config
20 changes: 20 additions & 0 deletions packages/prettier-config/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "@zazen/prettier-config",
"version": "0.0.0",
"description": "Apply a consistent code style, free of weariness and confusion",
"homepage": "https://github.com/stormwarning/zazen/blob/main/packages/prettier-config",
"repository": {
"type": "git",
"url": "git+https://github.com/stormwarning/zazen.git",
"directory": "packages/prettier-config"
},
"license": "ISC",
"author": "Jeff (https://tidaltheory.io)",
"type": "module",
"dependencies": {
"prettier-plugin-packagejson": "2.4.10"
},
"peerDependencies": {
"prettier": ">=3"
}
}
47 changes: 27 additions & 20 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d68405a

Please sign in to comment.