Skip to content

Commit

Permalink
feat: create prettier-config package
Browse files Browse the repository at this point in the history
  • Loading branch information
theurgi committed Oct 9, 2023
1 parent 1b504d2 commit 7d803df
Show file tree
Hide file tree
Showing 6 changed files with 129 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/small-bobcats-poke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@phi.school/prettier-config': minor
---

Initial release.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@commitlint/cli": "^17.7.1",
"@commitlint/config-conventional": "^17.7.0",
"@phi.school/eslint-config": "workspace:*",
"@phi.school/prettier-config": "workspace:*",
"@types/node": "^20.6.3",
"dotenv": "^16.3.1",
"eslint": "^8.49.0",
Expand All @@ -46,5 +47,6 @@
"lint-staged": {
"*.{js,ts}": "eslint --cache --fix",
"*.{js,json,md,ts}": "prettier --write"
}
},
"prettier": "@phi.school/prettier-config"
}
90 changes: 90 additions & 0 deletions packages/prettier-config/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<a name="readme-top"></a>

<br/>

<div align="center">

<h1>@phi.school/prettier-config</h1>

<p>
A Prettier configuration to enforce phi school's code style preferences.
</p>

<!-- Quick Project Links -->

[Changelog][changelog-link] · [Report Bug][github-issues-link] · [Request Feature][github-issues-link]

<!-- Shield Group -->

[![NPM Package Badge][npm-shield]][npm-link]

</div>

<br/>

## Table of Contents

- [Installation](#installation)
- [Usage](#usage)
- [Contributing](#contributing)
- [License](#license)

## Installation

```sh
pnpm i -D @phi.school/prettier-config
```

<div align="right">

[![Back to Top Badge][back-to-top]](#readme-top)

</div>

## Usage

Extend this package in your local prettier config or `package.json`:

**Prettier config:**

```json
// .prettierrc.json
"@phi.school/prettier-config"
```

**package.json:**

```json
{
"prettier": "@phi.school/prettier-config"
}
```

<div align="right">

[![Back to Top Badge][back-to-top]](#readme-top)

</div>

## Contributing

We welcome contributions! For a detailed guide on how to contribute, please refer to the [Contributing](../../README.md#contributing) section in the main README of the repository.

## License

Released under the [MIT](./LICENSE) License. © 2023-Present [phi school](https://phi.school)

<div align="right">

[![Back to Top Badge][back-to-top]](#readme-top)

</div>

<!-- Link Group -->

[back-to-top]: https://img.shields.io/badge/-⇧_Back_To_Top-black?style=flat-square
[changelog-link]: ./CHANGELOG.md
[github-issues-link]: https://github.com/phi-school/config/issues
[license]: ./LICENSE
[npm-link]: https://www.npmjs.com/package/@phi.school/prettier-config
[npm-shield]: https://img.shields.io/npm/v/@phi.school/prettier-config?color=black&style=for-the-badge
11 changes: 11 additions & 0 deletions packages/prettier-config/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "@phi.school/prettier-config",
"version": "0.0.0",
"publishConfig": {
"access": "public"
},
"main": "src/index.json",
"scripts": {
"lint": "eslint --cache ."
}
}
15 changes: 15 additions & 0 deletions packages/prettier-config/src/index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"printWidth": 80,
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"useTabs": true,
"overrides": [
{
"files": "*.{md,yaml,yml}",
"options": {
"useTabs": false
}
}
]
}
5 changes: 5 additions & 0 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 7d803df

Please sign in to comment.