You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I sometimes have to use both import and require as require is less strict. Like achieving lazy requiring or requiring without a cache (for testing). I think they should be sorted independently as import should be at the top, which makes it hard to mix them.
It's possible to mix, but imports are hoisted - so they will be evaluated first regardless.
That's a good reason to make this a rule though. If your import has side effects - the hoisting behavior can be confusing if you try to require something a line above an import that causes side effects.
Enforcing the rule puts them.in the order they would be evaluated anyways
I sometimes have to use both
import
andrequire
asrequire
is less strict. Like achieving lazy requiring or requiring without a cache (for testing). I think they should be sorted independently asimport
should be at the top, which makes it hard to mix them.Example: https://github.com/sindresorhus/atom-editorconfig/blob/0a32ee50684aa390d787ee5099cb11c31c94eedd/index.js#L4
The text was updated successfully, but these errors were encountered: