flightjs / generator-flight-package

A Yeoman generator for scaffolding a Flight package
http://flightjs.github.io
MIT License
10 stars 7 forks source link

Return function after defining #3

Closed danse closed 11 years ago

danse commented 11 years ago

After generating a package i see that the return statement in the component is before the component function definition. This is also the style used in general in flight documentation.

I would ask to invert the order, though, because using a function before declaring it raises an error on some linters.

necolas commented 11 years ago

Thanks but the generated package comes with a JSHint config that allows this. You should be using that.

Function hoisting is a feature of the language and in this case helps to expose early in the file that you're exporting a specific function as a flight component.