Skip to main content

Disallow function declarations that contain unsafe references inside loop statements (no-loop-func)

Rule Details

This rule extends the base eslint/no-loop-func rule. It adds support for TypeScript types.

How to Use

// note you must disable the base rule as it can report incorrect errors
"no-loop-func": "off",
"@typescript-eslint/no-loop-func": ["error"]


See eslint/no-loop-func options.

Taken with โค๏ธ from ESLint core


  • โœ… Recommended
  • ๐Ÿ”ง Fixable
  • ๐Ÿ’ญ Requires type information