molindo / eslint-config-molindo

ESLint config that implements the Molindo styleguide and helps to catch errors.
MIT License
1 stars 2 forks source link

Add `no-use-before-define` #22

Closed amannn closed 4 years ago

amannn commented 5 years ago

This can be tricky: A variable defined with const can be compiled via Babel to a regular var and therefore a violation of this rule might not throw in a browser. However if this code isn't compiled and run directly with modern tools where const is natively supported, a ReferenceError will be thrown.

https://eslint.org/docs/rules/no-use-before-define

amannn commented 5 years ago

However, allow the hoisting of function as this can be convenient.