Skip to main content

no-loop-func

Disallow function declarations that contain unsafe references inside loop statements.


此规则扩展了基本 eslint/no-loop-func 规则。 它增加了对 TypeScript 类型的支持。

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

如何使用

.eslintrc.cjs
module.exports = {
"rules": {
// Note: you must disable the base rule as it can report incorrect errors
"no-loop-func": "off",
"@typescript-eslint/no-loop-func": "error"
}
};
在线运行试试这个规则 ↗

选项

参见 eslint/no-loop-func 选项

资源

摘自 ❤️ ESLint 内核