no-use-before-define
Configuration
rslint.config.ts
Rule Details
Disallow the use of variables before they are defined.
This rule extends the base ESLint no-use-before-define rule to add support for TypeScript-specific constructs like type, interface, and enum declarations.
Examples of incorrect code for this rule:
Examples of correct code for this rule:
Options
functions(boolean, defaulttrue) - Whether to check function declarationsclasses(boolean, defaulttrue) - Whether to check class declarationsvariables(boolean, defaulttrue) - Whether to check variable declarationsenums(boolean, defaulttrue) - Whether to check enum declarationstypedefs(boolean, defaulttrue) - Whether to check type/interface declarationsignoreTypeReferences(boolean, defaulttrue) - Whether to ignore references in type annotationsallowNamedExports(boolean, defaultfalse) - Whether to allow references in named exports
Also accepts "nofunc" as a shorthand for { functions: false }.