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

Conversation

JamesCraster
Copy link
Contributor

@JamesCraster JamesCraster commented Mar 18, 2021

Hi, I was working with naming-convention recently. I was trying to remove an object prop ___typename from a rule. From the documentation at the time it wasn't entirely clear (to me) what the regex property should take:

let re = "/ab+c/i"; // literal notation
let re = "ab+c" // something to be passed into RegExp

This is important because for example new RegExp('/typename/') === '//typename//' and not "/typename/"

Also, I think that the args that RegExp is taking changes slightly in ES6?

I've proposed a small docs change.

Thanks!

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @JamesCraster!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitors per day.

@armano2 armano2 added documentation Documentation ("docs") that needs adding/updating package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin labels Mar 18, 2021
@bradzacher bradzacher changed the title docs(eslint-plugin) Update naming-convention.md to clarify literal regex notation vs. argument to RegExp docs(eslint-plugin): [naming-convention] clarify literal regex notation vs. argument to RegExp Mar 18, 2021
@bradzacher bradzacher merged commit 6703df1 into typescript-eslint:master Mar 18, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Documentation ("docs") that needs adding/updating package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants