Skip to content

Commit

Permalink
πŸ“ Write prettier readme
Browse files Browse the repository at this point in the history
  • Loading branch information
duchangkim committed Jun 18, 2024
1 parent d9b583e commit 9ed5c2f
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/heavy-mails-complain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@duchi/prettier-config": patch
---

Update readme
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# ν”„λ‘œμ νŠΈ μ†Œκ°œ

이 ν”„λ‘œμ νŠΈλŠ” 자주 μ‚¬μš©λ˜λŠ” ESLint 및 Prettier μ„€μ • νŒŒμΌμ„ μ€‘μ•™μ—μ„œ κ΄€λ¦¬ν•˜μ—¬, μƒˆλ‘œμš΄ ν”„λ‘œμ νŠΈλ₯Ό μ„€μ •ν•  λ•Œλ§ˆλ‹€ 반볡적으둜 μ„€μ • νŒŒμΌμ„ μž‘μ„±ν•  ν•„μš” 없이 κ°„νŽΈν•˜κ²Œ κ°€μ Έλ‹€ μ‚¬μš©ν•  수 μžˆλ„λ‘ λ•μŠ΅λ‹ˆλ‹€. 이λ₯Ό 톡해 μΌκ΄€λœ μ½”λ“œ μŠ€νƒ€μΌκ³Ό ν’ˆμ§ˆμ„ μœ μ§€ν•˜κ³  μ„€μ • μ‹œκ°„μ„ μ ˆμ•½ν•  수 μžˆμŠ΅λ‹ˆλ‹€.
이 ν”„λ‘œμ νŠΈλŠ” 자주 μ‚¬μš©λ˜λŠ” ESLint 및 Prettier λ˜λŠ” λ‹€λ₯Έ μ„€μ • νŒŒμΌμ„ μ€‘μ•™μ—μ„œ κ΄€λ¦¬ν•˜μ—¬, μƒˆλ‘œμš΄ ν”„λ‘œμ νŠΈλ₯Ό μ„€μ •ν•  λ•Œλ§ˆλ‹€ 반볡적으둜 μ„€μ • νŒŒμΌμ„ μž‘μ„±ν•  ν•„μš” 없이 κ°„νŽΈν•˜κ²Œ κ°€μ Έλ‹€ μ‚¬μš©ν•  수 μžˆλ„λ‘ λ•μŠ΅λ‹ˆλ‹€. 이λ₯Ό 톡해 μΌκ΄€λœ μ½”λ“œ μŠ€νƒ€μΌκ³Ό ν’ˆμ§ˆμ„ μœ μ§€ν•˜κ³  (λ‚˜μ˜)μ„€μ • μ‹œκ°„μ„ μ ˆμ•½ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

# μ„€μΉ˜ 및 μ‚¬μš© 방법

Expand Down
70 changes: 70 additions & 0 deletions packages/prettier-config/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# @duchi/prettier-config

## Installation

λ‹¨λ…μœΌλ‘œ μ‚¬μš©ν•  경우:

```bash
npm i -D @duchi/prettier-config
```

prettier와 ν•¨κ»˜ μ‚¬μš©ν•  경우:

```bash
npm i -D prettier @duchi/prettier-config
```

## Usage

이 Prettier ꡬ성을 μ‚¬μš©ν•˜λ €λ©΄ `package.json` νŒŒμΌμ— λ‹€μŒμ„ μΆ”κ°€ν•˜μ„Έμš”.

```json
{
// ... κΈ°μ‘΄ package.json λ‚΄μš©
"prettier": "@duchi/prettier-config"
}
```

λ˜λŠ” ν”„λ‘œμ νŠΈ λ£¨νŠΈμ— `.prettierrc`νŒŒμΌμ„ λ§Œλ“€κ³  λ‹€μŒμ„ μΆ”κ°€ν•˜μ„Έμš”.

```json
"@duchi/prettier-config"
```

## Configuration

`@duchi/prettier-config`λŠ” 미리 μ •μ˜λœ κ·œμΉ™ μ„ΈνŠΈλ₯Ό μ œκ³΅ν•©λ‹ˆλ‹€. κ·ΈλŸ¬λ‚˜ ν”„λ‘œμ νŠΈμ˜ Prettier ꡬ성 νŒŒμΌμ— μžμ‹ λ§Œμ˜ κ·œμΉ™μ„ μΆ”κ°€ν•˜μ—¬ κ·œμΉ™μ„ μž¬μ •μ˜ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

`.prettierrc`μ—μ„œ ꡬ성 μž¬μ •μ˜ μ˜ˆμ‹œ:

```json
{
"printWidth": 120,
"semi": false,
"singleQuote": false
}
```

## Extending the Configuration

ν•„μš”μ— 따라 이 ꡬ성을 ν™•μž₯ν•΄μ•Ό ν•˜λŠ” 경우 ν”„λ‘œμ νŠΈ λ£¨νŠΈμ— `prettier.config.js` λ˜λŠ” `.prettierrc.js` νŒŒμΌμ„ μƒμ„±ν•˜κ³  `@duchi/prettier-config` 섀정을 κ°€μ Έμ˜€λ©΄ λ©λ‹ˆλ‹€.

```js
module.exports = {
...require("@duchi/prettier-config"),
printWidth: 100,
semi: false,
};
```

### Prettier Configuration File

PrettierλŠ” λ‹€μ–‘ν•œ λ°©λ²•μœΌλ‘œ 섀정을 μ§€μ›ν•©λ‹ˆλ‹€. μ„€μ • νŒŒμΌμ€ λ‹€μŒ μˆœμ„œλŒ€λ‘œ μš°μ„ μˆœμœ„λ₯Ό κ°€μ§‘λ‹ˆλ‹€:

1. `package.json` 파일의 `"prettier"` ν‚€
2. `.prettierrc` 파일 (JSON λ˜λŠ” YAML ν˜•μ‹)
3. `.prettierrc.json`, `.prettierrc.yml`, `.prettierrc.yaml`, `.prettierrc.json5` 파일
4. `.prettierrc.js`, `prettier.config.js` 파일 (CommonJS λ˜λŠ” ES Module ν˜•μ‹)
5. `.prettierrc.toml` 파일

좜처: [Configuration File](https://prettier.io/docs/en/configuration.html)

0 comments on commit 9ed5c2f

Please sign in to comment.