Require var declarations at the top of their scope (vars-on-top)
Unreleased
Configuration
rslint.config.ts
The vars-on-top rule requires var declarations to appear before executable
statements in the program or in a function body. Directive strings and imports
may appear before the declarations. Declarations inside nested blocks and loop
headers are reported; declarations at the start of a class static block are
also allowed.
Rule Details
Examples of incorrect code:
Examples of correct code:
Differences from ESLint
rslint applies the same rule behavior to JavaScript and TypeScript syntax. As with ESLint, the rule has no options and reports the complete declaration.