Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[javascript, typescript] replace_magic_with_identifier #2265

Merged
merged 2 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ When possible, named constants are often a better choice than inlined literals b
The programmer might infer the meaning after reading the code carefully, but it is not obvious.
Magic values become particularly confusing when the same value is used for different purposes in one section of code.
- It is easier to alter the value, as it is not duplicated.
- It encourages and facilitates documentation.
- It encourages and facilitates documentation and translation.
- It aids with autocompletion in many IDEs.
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ When possible, named constants are often a better choice than inlined literals b
The programmer might infer the meaning after reading the code carefully, but it is not obvious.
Magic values become particularly confusing when the same value is used for different purposes in one section of code.
- It is easier to alter the value, as it is not duplicated.
- It encourages and facilitates documentation.
- It encourages and facilitates documentation and translation.
- It aids with autocompletion in many IDEs.
Loading