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

Add prettier-config package #215

Merged
merged 1 commit into from
Feb 8, 2024
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
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.

Loading