Skip to content

docs(eslint-plugin): [naming-convention] clarify literal regex notation vs. argument to RegExp #3198

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 18, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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