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.
This commit is contained in:
Tim van der Meij 2021-07-24 15:09:23 +02:00
parent 7b6767d415
commit fb99b0df0e
No known key found for this signature in database
GPG Key ID: 8C3FD2925A5F2762

View File

@ -61,6 +61,7 @@
"no-dupe-keys": "error", "no-dupe-keys": "error",
"no-duplicate-case": "error", "no-duplicate-case": "error",
"no-empty": ["error", { "allowEmptyCatch": true, }], "no-empty": ["error", { "allowEmptyCatch": true, }],
"no-empty-character-class": "error",
"no-ex-assign": "error", "no-ex-assign": "error",
"no-extra-boolean-cast": "error", "no-extra-boolean-cast": "error",
"no-func-assign": "error", "no-func-assign": "error",
@ -72,6 +73,7 @@
"no-regex-spaces": "error", "no-regex-spaces": "error",
"no-setter-return": "error", "no-setter-return": "error",
"no-sparse-arrays": "error", "no-sparse-arrays": "error",
"no-template-curly-in-string": "error",
"no-unexpected-multiline": "error", "no-unexpected-multiline": "error",
"no-unreachable": "error", "no-unreachable": "error",
"no-unsafe-finally": "error", "no-unsafe-finally": "error",