Skip to content

lib: add RegExp primordials - #31208

Closed
Sebastien-Ahkrin wants to merge 1 commit into
nodejs:masterfrom
Sebastien-Ahkrin:RegExpPrimordials
Closed

lib: add RegExp primordials#31208
Sebastien-Ahkrin wants to merge 1 commit into
nodejs:masterfrom
Sebastien-Ahkrin:RegExpPrimordials

Conversation

@Sebastien-Ahkrin

Copy link
Copy Markdown
Contributor

Hello,
For this PR I have added RegExp in the primordials eslint
And i just have created a line in "/lib/.eslintrc.yaml".

rules:
no-restricted-globals:
- name: RegExp message: "Use `const { RegExp } = primordials;` instead of the global."

And just add RegExp.

const{// [...]
RegExp,}=primordials;

I hope this new PR will help you :x

@nodejs-github-botnodejs-github-bot added the lib / src Issues and PRs related to general changes in the lib or src directory. label Jan 6, 2020
@Sebastien-Ahkrin

Copy link
Copy Markdown
ContributorAuthor

Refs: #30697

@trivikrtrivikr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is file print_help.js missed or not required?

returntext.replace(newRegExp(`([^\n]{0,${width}})( |$)`,'g'),

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@Trott

Trott commented Jan 7, 2020

Copy link
Copy Markdown
Member

Is file print_help.js missed or not required?

returntext.replace(newRegExp(`([^\n]{0,${width}})( |$)`,'g'),

It has a comment disabling the no-restricted-globals rule so maybe using git blame to look into why that was added would answer the question.

@targos

Copy link
Copy Markdown
Member

Apparently it was me who added this comment. I guess at that time that the file didn't have access to primordials. I don't know about now.

@Trott

Trott commented Jan 8, 2020

Copy link
Copy Markdown
Member

Apparently it was me who added this comment. I guess at that time that the file didn't have access to primordials. I don't know about now.

That file can probably be done separately in its own PR removing the ESLint comment and updating as appropriate.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@Trott

Trott commented Jan 8, 2020

Copy link
Copy Markdown
Member

Landed in a494d12

@TrottTrott closed this Jan 8, 2020
Trott pushed a commit that referenced this pull request Jan 8, 2020
PR-URL: #31208
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
MylesBorins pushed a commit that referenced this pull request Jan 16, 2020
PR-URL: #31208
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
@codebyterecodebytere mentioned this pull request Jan 16, 2020
codebytere pushed a commit that referenced this pull request Mar 14, 2020
PR-URL: #31208
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
@codebyterecodebytere mentioned this pull request Mar 17, 2020
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lib / srcIssues and PRs related to general changes in the lib or src directory.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

@Sebastien-Ahkrin@nodejs-github-bot@Trott@targos@jasnell@cjihrig@BridgeAR@trivikr