Require or disallow initialization in variable declarations.
// code-linter.json5
{
"rules": {
"@typescript-eslint/init-declarations": "error"
}
} // By default, the variable must be initialized at the time of declaration.
export function foo() {
console.info('hello');
}
export const bar = 1;
export const qux = 3; // By default, the variable must be initialized at the time of declaration.
export function foo() {
console.info('hello');
}
export let bar: string;
export let qux: number; plugin:@typescript-eslint/all
For details about how to configure Code Linter check rules, see Code Linter.