From fc4aee33db580dbe0a76529f19137e24b8ce31c4 Mon Sep 17 00:00:00 2001 From: Thomas Sibley Date: Tue, 19 Nov 2019 09:09:03 -0800 Subject: [PATCH] eslint: Allow functions to be used before they're defined 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. --- .eslintrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.eslintrc b/.eslintrc index 78a97a5f7..112c6e74a 100644 --- a/.eslintrc +++ b/.eslintrc @@ -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