From fb99b0df0ebde65ad2ae08a58dd12d5294bd0878 Mon Sep 17 00:00:00 2001 From: Tim van der Meij Date: Sat, 24 Jul 2021 15:09:23 +0200 Subject: [PATCH] Enable the `no-empty-character-class` and `no-template-curly-in-string` linting rules The former prevents unintended errors in regexes. The latter is something I ran into a couple of times before editors had proper support for syntax highlighting in template literals, and it's an easy mistake to make, especially when converting older code to use template literals. Nowadays most editors display template literals in different colors, but nevertheless it seems like a good idea to enable this rule. Fortunately both rules don't require any code changes, so it's more for prevention. --- .eslintrc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.eslintrc b/.eslintrc index 0a3fb2cfabf89..2d6e91587bf19 100644 --- a/.eslintrc +++ b/.eslintrc @@ -61,6 +61,7 @@ "no-dupe-keys": "error", "no-duplicate-case": "error", "no-empty": ["error", { "allowEmptyCatch": true, }], + "no-empty-character-class": "error", "no-ex-assign": "error", "no-extra-boolean-cast": "error", "no-func-assign": "error", @@ -72,6 +73,7 @@ "no-regex-spaces": "error", "no-setter-return": "error", "no-sparse-arrays": "error", + "no-template-curly-in-string": "error", "no-unexpected-multiline": "error", "no-unreachable": "error", "no-unsafe-finally": "error",