Skip to content

Commit

Permalink
refactor: add prettier-config readme (#57)
Browse files Browse the repository at this point in the history
* docs: move eslint-config README

* docs: add prettier-config README
  • Loading branch information
intersoom authored Sep 4, 2024
1 parent b03a003 commit 8b3d7ff
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 0 deletions.
File renamed without changes.
File renamed without changes.
32 changes: 32 additions & 0 deletions apps/docs/src/pages/prettier-config/prettier-config.en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## @yourssu/prettier-config

Prettier ruleset designed for the Yourssu Web-Frontend Team.

## Installation

```
npm install @yourssu/prettier-config
yarn add @yourssu/prettier-config
pnpm install @yourssu/prettier-config
```

## Rules

- `trailingComma: 'es5'` : trailing commas where valid in ES5 (objects, arrays, etc.). Trailing commas in type parameters in TypeScript and Flow.
- `printWidth: 100` : specify the line length that the printer will wrap on as 100.
- `semi: true` : Add a semicolon at the end of every statement.
- `singleQuote: true` : use single quotes
- `tabWidth: 2` : specify the number of spaces per indentation-level as 2.
- `arrowParens: 'always'` : Always include parens.<br/>
EX. `(x) => x` ⭕️, `x => x`
- `endOfLine: 'auto'` : maintain existing line endings (mixed values within one file are normalised by looking at what’s used after the first line)

## Usage

**package.json**

```
"prettier": "@yourssu/prettier-config"
```
32 changes: 32 additions & 0 deletions apps/docs/src/pages/prettier-config/prettier-config.ko.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## @yourssu/prettier-config

숭실대학교 동아리 유어슈 프론트엔드 팀을 위해 설계된 Prettier config입니다.

## Installation

```
npm install @yourssu/prettier-config
yarn add @yourssu/prettier-config
pnpm install @yourssu/prettier-config
```

## Rules

- `trailingComma: 'es5'` : 객체와 배열 같은 곳에서의 Trailing-comma를 허용한다. (타입스크립트 함수 파라미터에서는 비허용)
- `printWidth: 100` : 한 줄 당 코드 길이를 100으로 제한 한다.
- `semi: true` : 모든 문장의 끝에 세미콜론을 추가한다.
- `singleQuote: true` : `''`와 같은 작은 따옴표를 사용한다.
- `tabWidth: 2` : indent의 사이즈를 2로 설정한다.
- `arrowParens: 'always'` : 화살표 함수에서 부모를 포함한다.<br/>
EX. `(x) => x` ⭕️, `x => x`
- `endOfLine: 'auto'` : 기존 줄 끝 유지한다. (한 파일 내에서 혼합된 값은 첫 번째 줄 뒤에 사용된 것을 확인하여 정규화)

## Usage

**package.json**

```
"prettier": "@yourssu/prettier-config"
```

0 comments on commit 8b3d7ff

Please sign in to comment.