From e2cc125583cb3feed52dda4f82d4e9b6a4167496 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Fri, 8 Nov 2024 03:54:15 -0800 Subject: [PATCH] eslint: Exempt function variables from no-use-before-define. Signed-off-by: Anders Kaseorg --- .eslintrc.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index d7048a3046..18621ae5d5 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -104,7 +104,7 @@ module.exports = { "error", {args: "all", argsIgnorePattern: "^_", ignoreRestSiblings: true}, ], - "no-use-before-define": ["error", {functions: false}], + "no-use-before-define": ["error", {functions: false, variables: false}], "no-useless-concat": "error", "no-useless-constructor": "error", "no-var": "error", @@ -198,7 +198,10 @@ module.exports = { "error", {args: "all", argsIgnorePattern: "^_", ignoreRestSiblings: true}, ], - "@typescript-eslint/no-use-before-define": ["error", {functions: false}], + "@typescript-eslint/no-use-before-define": [ + "error", + {functions: false, variables: false}, + ], "@typescript-eslint/parameter-properties": "error", "@typescript-eslint/promise-function-async": "error", "@typescript-eslint/restrict-plus-operands": ["error", {}], @@ -249,7 +252,10 @@ module.exports = { "error", {args: "all", argsIgnorePattern: "^_", ignoreRestSiblings: true}, ], - "@typescript-eslint/no-use-before-define": ["error", {functions: false}], + "@typescript-eslint/no-use-before-define": [ + "error", + {functions: false, variables: false}, + ], "@typescript-eslint/parameter-properties": "error", "@typescript-eslint/promise-function-async": "error", "@typescript-eslint/restrict-plus-operands": ["error", {}],