Skip to content

Commit

Permalink
feat: add global prettier config (Shopify#15)
Browse files Browse the repository at this point in the history
## Context

Made one global config for prettier

## Changes

Created new config package with the prettier config

## Checklist

- [x] My code follows the style guidelines of this project
- [x] I've performed a self-review of my own code
- [x] I've added a changeset if this PR contains user-facing or
noteworthy changes
- [x] I've commented my code, particularly in hard-to-understand areas
- [x] I've made corresponding changes to the documentation
- [x] I've tested my code for breaking changes and added the
corresponding
      footer in this PR if needed
  • Loading branch information
remcolakens authored Jun 6, 2023
1 parent 7362686 commit aac866b
Show file tree
Hide file tree
Showing 8 changed files with 101 additions and 51 deletions.
5 changes: 5 additions & 0 deletions .changeset/cyan-dots-melt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@code-internet-applications/prettier-config': minor
---

Add initial directory and config for prettier
11 changes: 1 addition & 10 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,10 +1 @@
{
"bracketSpacing": true,
"printWidth": 80,
"proseWrap": "always",
"semi": true,
"singleQuote": true,
"useTabs": true,
"tabWidth": 2,
"trailingComma": "all"
}
"@code-internet-applications/prettier-config"
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"@changesets/changelog-github": "^0.4.8",
"@changesets/cli": "^2.26.1",
"@code-internet-applications/eslint-config-code": "workspace:*",
"@code-internet-applications/prettier-config": "workspace:*",
"@code-internet-applications/tsconfig": "workspace:*",
"@commitlint/cli": "^17.6.5",
"@commitlint/config-conventional": "^17.6.5",
Expand Down
10 changes: 10 additions & 0 deletions packages/config/prettier-config/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"bracketSpacing": true,
"printWidth": 80,
"proseWrap": "always",
"semi": true,
"singleQuote": true,
"useTabs": true,
"tabWidth": 2,
"trailingComma": "all"
}
Empty file.
34 changes: 34 additions & 0 deletions packages/config/prettier-config/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# @code-internet-applications/prettier-config

A sharable config for prettier

## Installation

```
pnpm add -D @code-internet-applications/prettier-config
```

## Usage

To use the library, install it and then add the following to your `.prettierrc`
file:

```
"@code-internet-applications/prettier-config"
```

## Contribution

See the
[contributing guidelines](https://github.com/code-internet-applications/cbt-hydrogen/blob/main/CONTRIBUTING.md)
for more details.

## Troubleshooting

To ensure that you can access the packages from the GitHub package registry,
make sure to add the following line to your `.npmrc` file in the root directory
of your project:

```
@code-internet-applications:registry=https://npm.pkg.github.com
```
16 changes: 16 additions & 0 deletions packages/config/prettier-config/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "@code-internet-applications/prettier-config",
"version": "0.0.0",
"sideEffects": false,
"description": "Shared prettier configuration",
"author": "Code Internet Applications <[email protected]>",
"repository": {
"type": "git",
"url": "https://github.com/code-internet-applications/cbt-hydrogen",
"directory": "packages/config/prettier-config"
},
"main": ".prettierrc.json",
"files": [
".prettierrc.json"
]
}
75 changes: 34 additions & 41 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 aac866b

Please sign in to comment.