Only functions names can have verbs (get, set, create, remove)
See original GitHub issueOK
function getMozzarella() {}
const createPizza = async () => {}
const mozzarella = getMozzarella();
const pizza = await createPizza(mozzarella);
NOT OK
const getMozzarella = await api();
const createPizza = new Pizza();
There are many verbs that should not be part of non-function variables, but I think the most common ones are enough:
get
set
unset
delete
add
remove
destroy
Maybe not:
clear // this is also an adjective
init // this could also be a noun for "initialization of X", a Promise that resolves with X
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Newbie's Cheatsheet: Commonly used verbs for naming ...
Newbie's Cheatsheet: Commonly used verbs for naming functions, methods and variables ; 2. Creation · create, 1B, Used when creating a resource.
Read more >Coding like Shakespeare: Practical Function Naming ...
The method name getAbsoluteDifference() means to get the absolute difference between the pair of numbers. The method name contains a verb get ....
Read more >Function naming conventions [closed] - Stack Overflow
One of the more universal, yet simple rules is: Function names should be verbs if the function changes the state of the program, ......
Read more >How to Better Name Your Functions and Variables - Medium
When naming a function, variable or class, you should keep the following things in mind: Choose a word with meaning (provide some context) ......
Read more >Approved Verbs for PowerShell Commands - Microsoft Learn
For example, always use Remove , never use Delete or Eliminate . Use only the form of each verb that is listed in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It’s a good idea, but like impossible to implement without type info.
Related: https://github.com/sindresorhus/eslint-plugin-unicorn/issues/347