Skip to content
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

lib: add RegExp primordials #31208

Closed

Conversation

Sebastien-Ahkrin
Copy link
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-bot nodejs-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
Contributor Author

Refs: #30697

Copy link
Member

@trivikr trivikr left a comment

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?

return text.replace(new RegExp(`([^\n]{0,${width}})( |$)`, 'g'),

@nodejs-github-bot
Copy link
Collaborator

@Trott
Copy link
Member

Trott commented Jan 7, 2020

Is file print_help.js missed or not required?

return text.replace(new RegExp(`([^\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
Member

targos commented Jan 7, 2020

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
Copy link
Member

Trott commented Jan 8, 2020

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
Collaborator

@Trott
Copy link
Member

Trott commented Jan 8, 2020

Landed in a494d12

@Trott Trott 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 <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
MylesBorins pushed a commit that referenced this pull request Jan 16, 2020
PR-URL: #31208
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
@codebytere codebytere 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 <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
@codebytere codebytere mentioned this pull request Mar 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lib / src Issues 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