Skip to content

Commit cb19177

Browse files
hamzahudaljharb
authored andcommittedAug 12, 2023
[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.
1 parent cda44da commit cb19177

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1964,7 +1964,7 @@ Other Style Guides
19641964
<a name="no-use-before-define"></a>
19651965
- [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)
19661966
1967-
> 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.
1967+
> 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.
19681968
19691969
```javascript
19701970
// bad

0 commit comments

Comments
 (0)
Failed to load comments.