Skip to content

Commit

Permalink
docs(eslint-plugin): [naming-convention] clarify literal regex notati…
Browse files Browse the repository at this point in the history
…on vs. argument to RegExp (#3198)
  • Loading branch information
JamesCraster committed Mar 18, 2021
1 parent 9ed3c50 commit 6703df1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/eslint-plugin/docs/rules/naming-convention.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand All @@ -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`.
Expand Down

0 comments on commit 6703df1

Please sign in to comment.