mirror of
https://github.com/labs42io/clean-code-typescript.git
synced 2025-04-18 15:13:34 +00:00
Addressing comments of #59:
- Removed "/Avoid magic literals" from the header to avoid noise. - Added back unnamed constants and kept magic strings, magic numbers as a note at the end of the paragraph.
This commit is contained in:
parent
36d14bf048
commit
d1e2cfb632
1 changed files with 2 additions and 2 deletions
|
@ -117,9 +117,9 @@ function getUser(): User;
|
|||
|
||||
**[⬆ back to top](#table-of-contents)**
|
||||
|
||||
### Use searchable names / Avoid Magic Literals
|
||||
### Use searchable names
|
||||
|
||||
We will read more code than we will ever write. It's important that the code we do write must be readable and searchable. By *not* naming variables that end up being meaningful for understanding our program, we hurt our readers. Make your names searchable. Tools like [ESLint](https://typescript-eslint.io/) can help identify magic literals.
|
||||
We will read more code than we will ever write. It's important that the code we do write must be readable and searchable. By *not* naming variables that end up being meaningful for understanding our program, we hurt our readers. Make your names searchable. Tools like [ESLint](https://typescript-eslint.io/) can help identify unnamed constants (also known as magic strings and magic numbers).
|
||||
|
||||
**Bad:**
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue