No rule for “Hoisting”
See original GitHub issueThe section “Hoisting” does a good job of explaining the ins and outs of hoisting, but states no rule about that.
For example I consider this a bad practice, because it leads to confusion and possible bugs:
function example() {
superPower(); // => Flying
function superPower() {
console.log('Flying');
}
}
Issue Analytics
- State:
- Created 8 years ago
- Comments:13 (3 by maintainers)
Top Results From Across the Web
1926.1431 - Hoisting personnel.
Personnel hoisting must not be conducted until the competent person determines that the platform and rigging have successfully passed the proof test. 1926.1431( ......
Read more >Hoisting - MDN Web Docs Glossary: Definitions of ... - Mozilla
JavaScript Hoisting refers to the process whereby the interpreter appears to move the declaration of functions, variables or classes to the ...
Read more >30 U.S. Code § 874 - Hoisting and mantrips - Law.Cornell.Edu
Where persons are transported into, or out of, a coal mine by hoists, a qualified hoisting engineer shall be on duty while any...
Read more >4999. Handling Loads.
(h) Loads shall not be released or detached from a crane or other hoisting apparatus until the qualified person (rigger) detaching the load...
Read more >Hoisting & Rigging Fundamentals
The safety policy “lf It's Not Safe, Don't Do ... the requirements of the DOE Hoisting and. Rigging program. It requires persons who...
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
I’d say it’s the rather opposite. With this rule you have to read the code backwards:
Instead of:
As far as I know, there are no side-effects of hoisting named function definitions, and it gives you the ability to have functions ordered in a more natural order. So my vote (if I have one 🐒) goes for relaxing this rule with “nofunc”.
The section for Functions is also kind of meaningless when it’s not allowed:
@ljharb you are right, in the actual implementation it will go inside a function so when called will have the right value. Overlooked that when doing the code simplification.
The design is based on the graphql interface type, like here, so I can’t redesign it.
But thanks for the clarification.