- https://eslint.org/docs/latest/rules/max-lines-per-function#rule-details
max-lines-per-function - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
eslint.org
- ESLint에는 max-lines-per-function이라는 rule이 존재. 함수의 코드가 길어질수록 문제를 일으킬 확률이 높고, 내부에서 추적이 어려워짐.
- 기본값으로 50줄 이상이 넘어가면 경고 메시지를 출력하며, 얼마나 많은 중첩, 콜백이 많은지도 확인가능하다.
- 한 개의 함수에서 너무 많은 일을 하지 않게 하는 것이 기본적인 규칙. "Do one thing and Do it well" -Malcolm Douglas Mcllory
| 클래스란? (0) | 2024.04.21 |
|---|---|
| 함수를 만들 때 주의사항 - 3. 이름은 간단명료하게 (0) | 2024.04.21 |
| 함수를 만들 때 주의사항 - 1. 부수효과를 억제하자 (0) | 2024.04.21 |
| 함수를 만들 때 주의사항 3가지 (0) | 2024.04.21 |
| 고차 함수 (0) | 2024.04.21 |