Skip to content

tools,lib: refactor prefer-primordials rule - #36018

Merged
aduh95 merged 1 commit into
nodejs:masterfrom
aduh95:prefer-primordials-refactor
Feb 16, 2021
Merged

tools,lib: refactor prefer-primordials rule#36018
aduh95 merged 1 commit into
nodejs:masterfrom
aduh95:prefer-primordials-refactor

Conversation

@aduh95

@aduh95aduh95 commented Nov 7, 2020

Copy link
Copy Markdown
Contributor

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

@aduh95aduh95 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 LekoNovember 7, 2020 12:10
@nodejs-github-botnodejs-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-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Nov 7, 2020
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@LekoLeko left a comment

Copy link
Copy Markdown
Contributor

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.

Comment threadtools/eslint-rules/prefer-primordials.js Outdated
Comment threadtest/parallel/test-eslint-prefer-primordials.js Outdated
Comment threadlib/.eslintrc.yaml Outdated
@aduh95
aduh95force-pushed the prefer-primordials-refactor branch from 5ef69fb to 601d050CompareNovember 7, 2020 16:45
@aduh95
aduh95 requested a review from LekoNovember 7, 2020 16:46
@aduh95

Copy link
Copy Markdown
ContributorAuthor

@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.

@aduh95aduh95 added the blocked PRs that are blocked by other issues or PRs. label Nov 7, 2020
@Trott

Copy link
Copy Markdown
Member

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

@aduh95
aduh95force-pushed the prefer-primordials-refactor branch from 601d050 to 599119cCompareNovember 14, 2020 19:02
@aduh95aduh95 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-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Nov 14, 2020
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

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

Copy link
Copy Markdown
Member

Blocked on nodejs/build#2504.

@ExE-Boss

Copy link
Copy Markdown
Contributor

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

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

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@aduh95

Copy link
Copy Markdown
ContributorAuthor

@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.

@LekoLeko left a comment

Copy link
Copy Markdown
Contributor

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

@aduh95aduh95 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
aduh95force-pushed the prefer-primordials-refactor branch from 599119c to 7fd6c20CompareFebruary 16, 2021 16:58
@aduh95

Copy link
Copy Markdown
ContributorAuthor

Landed in 7fd6c20

@aduh95
aduh95 merged commit 7fd6c20 into nodejs:masterFeb 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>
@targostargos mentioned this pull request Jun 6, 2021
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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.processIssues and PRs related to the process subsystem.toolsIssues and PRs related to the tools directory.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@aduh95@nodejs-github-bot@Trott@richardlau@ExE-Boss@Leko