Skip to main content

js/noRestrictedGlobals

disallow certain global variables

ESLint Equivalent: no-restricted-globals

Examples

Invalid

console.log(event);

 file.ts:1:12 lint/js/noRestrictedGlobals ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  Do not use the global variable event.

    console.log(event);
                ^^^^^

  Use a local variable instead.


foo(event)

 file.ts:1:4 lint/js/noRestrictedGlobals ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  Do not use the global variable event.

    foo(event)
        ^^^^^

  Use a local variable instead.

Valid

function foo(event) {
	console.info(event);
}