From da38192df53444e3156792900afa4902ef1d6b2a Mon Sep 17 00:00:00 2001 From: James Craster Date: Thu, 18 Mar 2021 10:09:50 +0000 Subject: [PATCH] Update naming-convention.md --- packages/eslint-plugin/docs/rules/naming-convention.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/eslint-plugin/docs/rules/naming-convention.md b/packages/eslint-plugin/docs/rules/naming-convention.md index ff9f8e79a3cf..4b28cffceafe 100644 --- a/packages/eslint-plugin/docs/rules/naming-convention.md +++ b/packages/eslint-plugin/docs/rules/naming-convention.md @@ -110,7 +110,7 @@ This can be useful if you want to enforce no particular format for a specific se The `custom` option defines a custom regex that the identifier must (or must not) match. This option allows you to have a bit more finer-grained control over identifiers, letting you ban (or force) certain patterns and substrings. Accepts an object with the following properties: -- `regex` - accepts a regular expression (anything accepted into `new RegExp(regex)`). +- `regex` - a string that is then passed into RegExp to create a new regular expression: `new RegExp(regex)` - `match` - true if the identifier _must_ match the `regex`, false if the identifier _must not_ match the `regex`. ### `filter` @@ -121,7 +121,7 @@ You can use this to include or exclude specific identifiers from specific config Accepts an object with the following properties: -- `regex` - accepts a regular expression (anything accepted into `new RegExp(regex)`). +- `regex` - a string that is then passed into RegExp to create a new regular expression: `new RegExp(regex)` - `match` - true if the identifier _must_ match the `regex`, false if the identifier _must not_ match the `regex`. Alternatively, `filter` accepts a regular expression (anything accepted into `new RegExp(filter)`). In this case, it's treated as if you had passed an object with the regex and `match: true`.