Skip to content

Commit

Permalink
translate(ko): Formatting (WIP)
Browse files Browse the repository at this point in the history
  • Loading branch information
738 committed Apr 15, 2020
1 parent ef7f75d commit d28fce3
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
7. [Testing](#testing)
8. [Concurrency](#concurrency)
9. [Error Handling](#error-handling)
10. [Formatting](#formatting)
10. [μ„œμ‹(Formatting)](#μ„œμ‹formatting)
11. [주석(Comments)](#주석comments)
12. [λ²ˆμ—­(Translations)](#λ²ˆμ—­translations)

Expand Down Expand Up @@ -2471,31 +2471,34 @@ try {

**[⬆ μƒλ‹¨μœΌλ‘œ](#λͺ©μ°¨)**

## Formatting
## μ„œμ‹(Formatting)

Formatting is subjective. Like many rules herein, there is no hard and fast rule that you must follow. The main point is *DO NOT ARGUE* over formatting. There are tons of tools to automate this. Use one! It's a waste of time and money for engineers to argue over formatting. The general rule to follow is *keep consistent formatting rules*.
μ„œμ‹μ€ μ£Όκ΄€μ μž…λ‹ˆλ‹€. 여기에 μžˆλŠ” λ§Žμ€ κ·œμΉ™λ“€κ³Ό 같이 당신이 λ”°λ₯΄κΈ° μ–΄λ €μš΄ κ·œμΉ™μ€ μ—†μŠ΅λ‹ˆλ‹€. μ€‘μš”ν•œ 점은 μ„œμ‹μ— λŒ€ν•΄μ„œ *λ…ΌμŸν•˜μ§€ μ•ŠλŠ” 것*μž…λ‹ˆλ‹€. μ„œμ‹μ„ μžλ™ν™”ν•˜κΈ° μœ„ν•œ 도ꡬ듀이 맀우 λ§ŽμŠ΅λ‹ˆλ‹€. κ·Έ 쀑 ν•˜λ‚˜λ₯Ό μ‚¬μš©ν•˜μ„Έμš”! μ„œμ‹μ— λŒ€ν•΄ λ…ΌμŸν•˜λŠ” 것은 μ—”μ§€λ‹ˆμ–΄μ—κ²Œ μ‹œκ°„κ³Ό 돈 낭비일 λΏμž…λ‹ˆλ‹€. λ”°λΌμ•Όν•˜λŠ” 일반적인 κ·œμΉ™μ€ *일관적인 μ„œμ‹ κ·œμΉ™μ„ μ§€μΌœμ•Όν•˜λŠ” κ²ƒμž…λ‹ˆλ‹€*.

For TypeScript there is a powerful tool called [TSLint](https://palantir.github.io/tslint/). It's a static analysis tool that can help you improve dramatically the readability and maintainability of your code. There are ready to use TSLint configurations that you can reference in your projects:
[TSLint](https://palantir.github.io/tslint/)라고 λΆˆλ¦¬λŠ” νƒ€μž…μŠ€ν¬λ¦½νŠΈλ₯Ό μœ„ν•œ κ°•λ ₯ν•œ 도ꡬ가 μžˆμŠ΅λ‹ˆλ‹€. 이것은 μ½”λ“œμ˜ 가독성과 μœ μ§€λ³΄μˆ˜μ„±μ„ 극적으둜 κ°œμ„ μ‹œν‚€λ„λ‘ λ„μ™€μ£ΌλŠ” 정적 뢄석 λ„κ΅¬μž…λ‹ˆλ‹€.
ν”„λ‘œμ νŠΈμ— μ°Έκ³ ν•  수 μžˆλŠ” TSLint 섀정을 μ‚¬μš©ν•  μ€€λΉ„κ°€ λ˜μ—ˆμŠ΅λ‹ˆλ‹€:

- [TSLint Config Standard](https://www.npmjs.com/package/tslint-config-standard) - standard style rules
- [TSLint Config Standard](https://www.npmjs.com/package/tslint-config-standard) - ν‘œμ€€ μŠ€νƒ€μΌ κ·œμΉ™

- [TSLint Config Airbnb](https://www.npmjs.com/package/tslint-config-airbnb) - Airbnb style guide
- [TSLint Config Airbnb](https://www.npmjs.com/package/tslint-config-airbnb) - 에어비엔비 μŠ€νƒ€μΌ κ°€μ΄λ“œ

- [TSLint Clean Code](https://www.npmjs.com/package/tslint-clean-code) - TSLint rules inspired by the [Clean Code: A Handbook of Agile Software Craftsmanship](https://www.amazon.ca/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882)
- [TSLint Clean Code](https://www.npmjs.com/package/tslint-clean-code) - [Clean Code: A Handbook of Agile Software Craftsmanship](https://www.amazon.ca/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882)에 영감 받은 TSLint κ·œμΉ™

- [TSLint react](https://www.npmjs.com/package/tslint-react) - lint rules related to React & JSX
- [TSLint react](https://www.npmjs.com/package/tslint-react) - React & JSX와 κ΄€λ ¨λœ lint κ·œμΉ™

- [TSLint + Prettier](https://www.npmjs.com/package/tslint-config-prettier) - lint rules for [Prettier](https://github.com/prettier/prettier) code formatter
- [TSLint + Prettier](https://www.npmjs.com/package/tslint-config-prettier) - [Prettier](https://github.com/prettier/prettier) μ½”λ“œ 포맷터λ₯Ό μœ„ν•œ lint κ·œμΉ™

- [ESLint rules for TSLint](https://www.npmjs.com/package/tslint-eslint-rules) - ESLint rules for TypeScript
- [ESLint rules for TSLint](https://www.npmjs.com/package/tslint-eslint-rules) - νƒ€μž…μŠ€ν¬λ¦½νŠΈλ₯Ό μœ„ν•œ ESLint κ·œμΉ™

- [Immutable](https://www.npmjs.com/package/tslint-immutable) - rules to disable mutation in TypeScript
- [Immutable](https://www.npmjs.com/package/tslint-immutable) - νƒ€μž…μŠ€ν¬λ¦½νŠΈμ—μ„œ 변경을 ν—ˆλ½ν•˜μ§€ μ•ŠλŠ” κ·œμΉ™

Refer also to this great [TypeScript StyleGuide and Coding Conventions](https://basarat.gitbook.io/typescript/styleguide) source.
λ˜ν•œ, ν›Œλ₯­ν•œ 자료인 [νƒ€μž…μŠ€ν¬λ¦½νŠΈ μŠ€νƒ€μΌ κ°€μ΄λ“œμ™€ μ½”λ”© μ»¨λ²€μ…˜](https://basarat.gitbook.io/typescript/styleguide)을 μ°Έκ³ ν•΄μ£Όμ„Έμš”.

### Use consistent capitalization
> μ—­μžμ£Ό: TSLintλŠ” deprecatedλ˜μ—ˆμŠ΅λ‹ˆλ‹€. [Roadmap: TSLint -> ESLint](https://github.com/palantir/tslint/issues/4534) 이슈λ₯Ό ν™•μΈν•΄μ£Όμ„Έμš”.

Capitalization tells you a lot about your variables, functions, etc. These rules are subjective, so your team can choose whatever they want. The point is, no matter what you all choose, just *be consistent*.
### μΌκ΄€μ μœΌλ‘œ λŒ€μ†Œλ¬Έμžλ₯Ό μ‚¬μš©ν•˜μ„Έμš”

λŒ€μ†Œλ¬Έμžλ₯Ό κ΅¬λΆ„ν•˜μ—¬ μž‘μ„±ν•˜λŠ” 것은 λ‹Ήμ‹ μ—κ²Œ λ³€μˆ˜, ν•¨μˆ˜ 등에 λŒ€ν•΄μ„œ λ§Žμ€ 것을 μ•Œλ €μ€λ‹ˆλ‹€. 이 κ·œμΉ™μ€ μ£Όκ΄€μ μ΄μ–΄μ„œ, λ‹Ήμ‹ μ˜ νŒ€μ΄ μ›ν•˜λŠ” 것을 선택해야 ν•©λ‹ˆλ‹€. μ€‘μš”ν•œ 점은 μ–΄λ–€ κ±Έ μ„ νƒν•˜μ˜€λ“ μ§€ 간에 *일관적*이어야 ν•œλ‹€λŠ” κ²ƒμž…λ‹ˆλ‹€.

**Bad:**

Expand Down Expand Up @@ -2669,11 +2672,11 @@ import { ConfigPlugin } from './plugins/config/configPlugin';
**[⬆ μƒλ‹¨μœΌλ‘œ](#λͺ©μ°¨)**
### Use typescript aliases
### νƒ€μž…μŠ€ν¬λ¦½νŠΈ μ•¨λ¦¬μ–΄μŠ€λ₯Ό μ‚¬μš©ν•˜μ„Έμš”
Create prettier imports by defining the paths and baseUrl properties in the compilerOptions section in the `tsconfig.json`
`tsconfig.json`의 `compilerOptions` μ„Ήμ…˜ μ•ˆμ—μ„œ `paths`와 `baseUrl` 속성을 μ •μ˜ν•΄ 더 보기 쒋은 import ꡬ문을 μž‘μ„±ν•΄μ£Όμ„Έμš”.
This will avoid long relative paths when doing imports.
이 방법은 import ꡬ문을 μ‚¬μš©ν•  λ•Œ κΈ΄ μƒλŒ€κ²½λ‘œλ₯Ό μž‘μ„±ν•˜λŠ” 것을 ν”Όν•˜κ²Œ 도와쀄 κ²ƒμž…λ‹ˆλ‹€.
**Bad:**
Expand Down

0 comments on commit d28fce3

Please sign in to comment.