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

tools,lib: refactor prefer-primordials rule #36018

Merged
merged 1 commit into from
Feb 16, 2021

Conversation

aduh95
Copy link
Contributor

@aduh95 aduh95 commented Nov 7, 2020

Refactor the ESLint rule source code to improve readability.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

@aduh95 aduh95 added the request-ci Add this label to start a Jenkins CI on a PR. label Nov 7, 2020
@aduh95 aduh95 requested a review from Leko November 7, 2020 12:10
@nodejs-github-bot nodejs-github-bot added process Issues and PRs related to the process subsystem. tools Issues and PRs related to the tools directory. labels Nov 7, 2020
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Nov 7, 2020
@nodejs-github-bot
Copy link
Collaborator

Copy link
Contributor

@Leko Leko left a comment

Choose a reason for hiding this comment

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

Could you separate this pull request for each purpose?

  1. Refactoring of the rule
  2. Add Safe prefix on the Map and Set, etc.
  3. Replace prototype property with primordials.

tools/eslint-rules/prefer-primordials.js Show resolved Hide resolved
test/parallel/test-eslint-prefer-primordials.js Outdated Show resolved Hide resolved
lib/.eslintrc.yaml Outdated Show resolved Hide resolved
@aduh95 aduh95 force-pushed the prefer-primordials-refactor branch from 5ef69fb to 601d050 Compare November 7, 2020 16:45
@aduh95 aduh95 requested a review from Leko November 7, 2020 16:46
@aduh95
Copy link
Contributor Author

aduh95 commented Nov 7, 2020

@Leko I've split the PR as requested (#36025 and #36026).
This is blocked by #36025 and the node-test-linter failure due to the lack of support for optional chaining and null coalescing operator.

@aduh95 aduh95 added the blocked PRs that are blocked by other issues or PRs. label Nov 7, 2020
@Trott
Copy link
Member

Trott commented Nov 14, 2020

Not sure if this needs to be rebased or closed (since it overlaps with PRs that landed?) but one or the other.

@aduh95 aduh95 added request-ci Add this label to start a Jenkins CI on a PR. and removed blocked PRs that are blocked by other issues or PRs. labels Nov 14, 2020
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Nov 14, 2020
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@richardlau richardlau added the blocked PRs that are blocked by other issues or PRs. label Dec 21, 2020
@richardlau
Copy link
Member

Blocked on nodejs/build#2504.

@ExE-Boss
Copy link
Contributor

nodejs/build#2504 has now been fixed by nodejs/build#2514.

@richardlau richardlau removed the blocked PRs that are blocked by other issues or PRs. label Feb 15, 2021
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@aduh95
Copy link
Contributor Author

aduh95 commented Feb 15, 2021

@Leko I think this is ready to land, would you kindly have another look at this PR, I believe I've addressed all your objections.

Copy link
Contributor

@Leko Leko left a comment

Choose a reason for hiding this comment

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

@aduh95 Thank you for a lot of works to support optional chaining! LGTM

@aduh95 aduh95 added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Feb 16, 2021
Use optional chaining to improve code readability and remove use of
`Array.prototype.reduce`.

PR-URL: nodejs#36018
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
@aduh95
Copy link
Contributor Author

aduh95 commented Feb 16, 2021

Landed in 7fd6c20

@aduh95 aduh95 merged commit 7fd6c20 into nodejs:master Feb 16, 2021
@aduh95 aduh95 deleted the prefer-primordials-refactor branch February 16, 2021 16:59
danielleadams pushed a commit that referenced this pull request Feb 16, 2021
Use optional chaining to improve code readability and remove use of
`Array.prototype.reduce`.

PR-URL: #36018
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
This was referenced Feb 16, 2021
targos pushed a commit that referenced this pull request May 27, 2021
Use optional chaining to improve code readability and remove use of
`Array.prototype.reduce`.

PR-URL: #36018
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
targos pushed a commit that referenced this pull request May 30, 2021
Use optional chaining to improve code readability and remove use of
`Array.prototype.reduce`.

PR-URL: #36018
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
targos pushed a commit that referenced this pull request Jun 5, 2021
Use optional chaining to improve code readability and remove use of
`Array.prototype.reduce`.

PR-URL: #36018
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
targos pushed a commit that referenced this pull request Jun 11, 2021
Use optional chaining to improve code readability and remove use of
`Array.prototype.reduce`.

PR-URL: #36018
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. process Issues and PRs related to the process subsystem. tools Issues and PRs related to the tools directory.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants