missing function expression name : naming / semantics
See original GitHub issueAssuming a function expression that toggles the visibility of <tr>
s depending on some criteria,
const filterRows = function () {
...
}
39:23 warning Missing function expression name func-names
I’m running into difficulty finding a name for that function expression as the rule suggests. More often it would be pure duplication of the variable in which the function is saved.
Any ideas on how to properly redact a meaningful name that isn’t a duplicate of the variable name?
Issue Analytics
- State:
- Created 7 years ago
- Comments:5
Top Results From Across the Web
Function expression - JavaScript - MDN Web Docs
The name doesn't change if it's assigned to a different variable. If function name is omitted, it will be the variable name (implicit...
Read more >Coding like Shakespeare: Practical Function Naming ...
6. Avoid the same concept covered by many names · Verify the application for functions with the same behavior. Use the matched function...
Read more >The names of functions in ES6 - 2ality
Function declarations and function expression are function definitions. This scenario has been supported for a long time: a function definition ...
Read more >Why use named function expressions? - Stack Overflow
Naming functions is useful if they need to reference themselves (e.g. for recursive calls). Indeed, if you are ...
Read more >func-names - ESLint - Pluggable JavaScript Linter
"never" disallows named function expressions, except in recursive functions, where a name is needed. This rule has an object option: "generators": "always" |...
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 FreeTop 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
Top GitHub Comments
The value I see is that in stack traces, you’ll see a very specific function name, which you can grep for across your whole codebase and find in only one location, whereas the generic name might appear in a handful of files.
@ljharb semantically that doesn’t add any value though right? you could very well use a specific and verbose var name…