Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
feat(eslint-plugin): add extension rule `no-loop-func` (#2490)
- Loading branch information
Showing
with
1,038 additions
and 38 deletions.
- +31 −30 packages/eslint-plugin/README.md
- +22 −0 packages/eslint-plugin/docs/rules/no-loop-func.md
- +2 −0 packages/eslint-plugin/src/configs/all.ts
- +10 −8 packages/eslint-plugin/src/rules/index.ts
- +220 −0 packages/eslint-plugin/src/rules/no-loop-func.ts
- +738 −0 packages/eslint-plugin/tests/rules/no-loop-func.test.ts
- +15 −0 packages/eslint-plugin/typings/eslint-rules.d.ts
@@ -0,0 +1,22 @@ | ||
# Disallow function declarations that contain unsafe references inside loop statements (`no-loop-func`) | ||
|
||
## Rule Details | ||
|
||
This rule extends the base [`eslint/no-loop-func`](https://eslint.org/docs/rules/no-loop-func) rule. | ||
It adds support for TypeScript types. | ||
|
||
## How to use | ||
|
||
```cjson | ||
{ | ||
// note you must disable the base rule as it can report incorrect errors | ||
"no-loop-func": "off", | ||
"@typescript-eslint/no-loop-func": ["error"] | ||
} | ||
``` | ||
|
||
## Options | ||
|
||
See [`eslint/no-loop-func` options](https://eslint.org/docs/rules/no-loop-func#options). | ||
|
||
<sup>Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/no-loop-func.md)</sup> |
Oops, something went wrong.