From cb191776dbdd2c8674fc81a6850c4c1377af46e6 Mon Sep 17 00:00:00 2001 From: hamzahuda <116317495+hamzahuda@users.noreply.github.com> Date: Sat, 12 Aug 2023 12:19:30 +0100 Subject: [PATCH] [readme] correct no-use-before-define justification The recommendation is to declare the variables, classes and functions before. So the contrasting negative example should say after. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 88b1d11ddf..e7ed4d29ae 100644 --- a/README.md +++ b/README.md @@ -1964,7 +1964,7 @@ Other Style Guides - [14.5](#no-use-before-define) Variables, classes, and functions should be defined before they can be used. eslint: [`no-use-before-define`](https://eslint.org/docs/latest/rules/no-use-before-define) - > Why? When variables, classes, or functions are declared before being used, it can harm readability since a reader won't know what a thing that's referenced is. It's much clearer for a reader to first encounter the source of a thing (whether imported from another module, or defined in the file) before encountering a use of the thing. + > Why? When variables, classes, or functions are declared after being used, it can harm readability since a reader won't know what a thing that's referenced is. It's much clearer for a reader to first encounter the source of a thing (whether imported from another module, or defined in the file) before encountering a use of the thing. ```javascript // bad