Option to ignore arrow functions in `consistent-function-scoping`
See original GitHub issuePlease allow the option to ignore arrow functions in the consistent-function-scoping
rule. Sometimes I create a one liner function, and I don’t want to have to move it to the highest scope.
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (5 by maintainers)
Top Results From Across the Web
prefer-arrow-callback - ESLint - Pluggable JavaScript Linter
Arrow functions can be an attractive alternative to function expressions for callbacks or function arguments. For example, arrow functions are automatically ...
Read more >unbound-method | typescript-eslint
If your function does not access this , you can annotate it with this: void , or consider using an arrow function instead....
Read more >ES6 arrow functions, syntax and lexical scoping
Arrow functions are always anonymous, which means we can't do this with ES6: // ES5 function doSomething() { //... }.
Read more >Enforce the location of arrow function bodies with implicit ...
An arrow function body can contain an implicit return as an expression instead of a block body. It can be useful to enforce...
Read more >JSHint Options Reference
Setting this option to "nofunc" will allow function declarations to be ignored. For more in-depth understanding of scoping and hoisting in JavaScript, read ......
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
How about this simple example with Redux Thunk?
Arrow function (throws error):
Function declaration (no error):
Is it bug or feature? Is it normal or not?
I took a quick look, it’s caused by
scopeManager.acquire
it can’t get scope, not sure how to fix it, maybe later.