Skip to content

lib: refactor to reuse validators - #38608

Closed
pd4d10 wants to merge 2 commits into
nodejs:masterfrom
pd4d10:patch-lib-validator
Closed

lib: refactor to reuse validators#38608
pd4d10 wants to merge 2 commits into
nodejs:masterfrom
pd4d10:patch-lib-validator

Conversation

@pd4d10

Copy link
Copy Markdown
Contributor

No description provided.

@github-actionsgithub-actionsBot added lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels May 9, 2021
Comment threadlib/_tls_wrap.js Outdated
Comment threadlib/internal/perf/timerify.js Outdated
Comment threadlib/internal/process/per_thread.js Outdated
Comment threadlib/util.js Outdated
Comment threadlib/vm.js Outdated
Comment threadlib/wasi.js Outdated
Comment threadlib/zlib.js Outdated

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.

nit: trailing comma

@pd4d10pd4d10May 9, 2021

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

OK. But the lint seems to pass. Shall we add this to the lint rule?

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.

OK. But the lint seems passed. Shall we add this to the lint rule?

It would be nice if the lint rule could be added

@RaisinTen

Copy link
Copy Markdown
Member

Why is this happening? 👀

make[2]: Leaving directory '/home/runner/work/node/node/benchmark/napi/type-tag-check/build'npm ERR! normalizeEncoding is not a functionmake[1]: *** [Makefile:689: tools/doc/node_modules] Error 1

@pd4d10
pd4d10force-pushed the patch-lib-validator branch from f55af36 to 92726a9CompareMay 16, 2021 11:23
@pd4d10
pd4d10 requested a review from LxxyxMay 16, 2021 11:24
Comment threadlib/events.js Outdated
Comment threadlib/_tls_wrap.js Outdated
Comment threadlib/_http_agent.js Outdated
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@pd4d10
pd4d10force-pushed the patch-lib-validator branch from 8659f35 to fce76feCompareMay 16, 2021 15:36
@pd4d10

Copy link
Copy Markdown
ContributorAuthor

It seems that we should leave lib/util.js as is since lib/internal/validators.js depends on it, which is the cause of test failure.

Updated

@aduh95

Copy link
Copy Markdown
Contributor

It seems that we should leave lib/util.js as is since lib/internal/validators.js depends on it, which is the cause of test failure.

Most likely the error comes from lib/internal/util.js, not lib/utils.js: adding the require call there is creating a circular dependency hence the not defined error.

@pd4d10
pd4d10force-pushed the patch-lib-validator branch from 1648190 to 48d020cCompareMay 16, 2021 15:49
@pd4d10

Copy link
Copy Markdown
ContributorAuthor

It seems that we should leave lib/util.js as is since lib/internal/validators.js depends on it, which is the cause of test failure.

Most likely the error comes from lib/internal/util.js, not lib/utils.js: adding the require call there is creating a circular dependency hence the not defined error.

Yeah, you are right. I misread the file name.

Updated

@aduh95

Copy link
Copy Markdown
Contributor

FYI force pushing makes the review process a bit harder, if you could prefer fixup commits instead that'd be nice. FYI you can update your local branch using git pull git@github.com:pd4d10/node.git patch-lib-validator.
Could you please reaply 1648190, it seems it was lost during the force-push.

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
@pd4d10

Copy link
Copy Markdown
ContributorAuthor

FYI force pushing makes the review process a bit harder, if you could prefer fixup commits instead that'd be nice. FYI you can update your local branch using git pull git@github.com:pd4d10/node.git patch-lib-validator.
Could you please reaply 1648190, it seems it was lost during the force-push.

OK, get it. Updated

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@aduh95aduh95 added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label May 16, 2021
@nodejs-github-bot

nodejs-github-bot commented May 16, 2021

Copy link
Copy Markdown
Collaborator

pd4d10 added a commit to pd4d10/node that referenced this pull request May 18, 2021
The advantage of doing this is that `eslint --fix` can automatically add
trailing commas, which avoids wasting time on manual formatting
Refs: https://github.com/nodejs/node/discussions/38701
Refs: nodejs#38608 (review)
jasnell pushed a commit that referenced this pull request May 19, 2021
PR-URL: #38608
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@jasnell

Copy link
Copy Markdown
Member

Landed in 5d7b6c2

@jasnelljasnell closed this May 19, 2021
@pd4d10
pd4d10 deleted the patch-lib-validator branch May 19, 2021 16:26
danielleadams pushed a commit that referenced this pull request May 31, 2021
PR-URL: #38608
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@danielleadamsdanielleadams mentioned this pull request May 31, 2021
@richardlau

Copy link
Copy Markdown
Member

This appears to depend on #37045 so adding a matching backport label.

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.lib / srcIssues and PRs related to general changes in the lib or src directory.needs-ciPRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

@pd4d10@RaisinTen@nodejs-github-bot@aduh95@jasnell@richardlau@Trott@Lxxyx