Skip to content

Commit

Permalink
eslint: Allow functions to be used before they're defined
Browse files Browse the repository at this point in the history
Functions are hoisted so it is completely safe to use them before
they're defined.

Removing this ESLint restriction allows the very nice pattern of putting
higher-level functions at the top of a file and the lower-level
functions it calls at the bottom.  By putting callers before callees,
source files are well organized for top-to-bottom readability.
  • Loading branch information
tsibley committed Nov 19, 2019
1 parent f90231f commit fc4aee3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ rules:
react-hooks/rules-of-hooks: "error"
react-hooks/exhaustive-deps: "warn"
react/no-danger: off # gatsby uses this a lot
no-use-before-define: ["error", { "functions": false }]
parserOptions:
ecmaVersion: 6
sourceType: module
Expand Down

0 comments on commit fc4aee3

Please sign in to comment.