From cd039517d23f0f3458e269ed899c84b788fb91cf Mon Sep 17 00:00:00 2001 From: Krzysztof Wolski Date: Fri, 22 Jul 2022 17:53:33 +0200 Subject: [PATCH] Lint for using `for ... in` in favor of `for ... of` Co-authored-by: Jonatan Witoszek --- .eslintrc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.eslintrc b/.eslintrc index 7eceb7e..a70a846 100644 --- a/.eslintrc +++ b/.eslintrc @@ -12,7 +12,14 @@ "react/react-in-jsx-scope": "off", // next does not require react imports "import/extensions": "off", // file extension not required when importing "react/jsx-filename-extension": "off", - "no-restricted-syntax": "off", + "no-restricted-syntax": [ + "error", + { + selector: "ForInStatement", + message: "for ... in disallowed, use for ... of instead", + }, + ], + "no-underscore-dangle": "off", "no-await-in-loop": "off", "react/jsx-props-no-spreading": "off",