Skip to content

Commit 6703df1

Browse files
authored
docs(eslint-plugin): [naming-convention] clarify literal regex notation vs. argument to RegExp (typescript-eslint#3198)
1 parent 9ed3c50 commit 6703df1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/eslint-plugin/docs/rules/naming-convention.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ This can be useful if you want to enforce no particular format for a specific se
110110
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.
111111
Accepts an object with the following properties:
112112

113-
- `regex` - accepts a regular expression (anything accepted into `new RegExp(regex)`).
113+
- `regex` - a string that is then passed into RegExp to create a new regular expression: `new RegExp(regex)`
114114
- `match` - true if the identifier _must_ match the `regex`, false if the identifier _must not_ match the `regex`.
115115

116116
### `filter`
@@ -121,7 +121,7 @@ You can use this to include or exclude specific identifiers from specific config
121121

122122
Accepts an object with the following properties:
123123

124-
- `regex` - accepts a regular expression (anything accepted into `new RegExp(regex)`).
124+
- `regex` - a string that is then passed into RegExp to create a new regular expression: `new RegExp(regex)`
125125
- `match` - true if the identifier _must_ match the `regex`, false if the identifier _must not_ match the `regex`.
126126

127127
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`.

0 commit comments

Comments
 (0)