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

chore: update dlint to v0.37.0 for GitHub Actions #17295

Merged
merged 14 commits into from
Jan 16, 2023

Conversation

petamoriken
Copy link
Contributor

@petamoriken petamoriken commented Jan 7, 2023

Updated third_party dlint to v0.37.0 for GitHub Actions. This PR includes following changes:

  • fix(prefer-primordials): Stop using array pattern assignments
  • fix(prefer-primordials): Stop using global intrinsics except for SharedArrayBuffer
  • feat(guard-for-in): Apply new guard-for-in rule

@petamoriken
Copy link
Contributor Author

It appears that SharedArrayBuffer has not yet been initialized in primordials.js

@petamoriken petamoriken marked this pull request as ready for review January 7, 2023 12:55
@petamoriken petamoriken changed the title chore: update dlint for CI chore: update dlint to v0.37.0 for GitHub CI Jan 7, 2023
@petamoriken petamoriken changed the title chore: update dlint to v0.37.0 for GitHub CI chore: update dlint to v0.37.0 for GitHub Actions Jan 7, 2023
@bartlomieju
Copy link
Member

It appears that SharedArrayBuffer has not yet been initialized in primordials.js

That's not possible, somehow SharedArrayBuffer is not available during snapshotting (possibly a v8 bug)

@petamoriken
Copy link
Contributor Author

I did not seem to be able to solve the SharedArrayBuffer problem right away, so I ignored it.

@@ -139,7 +139,7 @@

#pollControl = async () => {
while (this.#status === "RUNNING") {
const [type, data] = await hostRecvCtrl(this.#id);
const { 0: type, 1: data } = await hostRecvCtrl(this.#id);
Copy link
Member

Choose a reason for hiding this comment

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

I don't really get these changes, @petamoriken could you explain what's the advantage of using this syntax over array destructuring?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Okay, I'm asking because I see changes in test files that are a bit surprising - these tests should ideally be checked with exactly same rules as user code since they are testing public API that users would use. Do you think we should revert changes to test code?

Copy link
Contributor Author

@petamoriken petamoriken Jan 9, 2023

Choose a reason for hiding this comment

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

IMO, modern for-of should be used in test files, not for-in, which has traps. I believe it is worthwhile to apply the guard-for-in rule to test files.

@@ -351,8 +350,8 @@ async function update() {

const currentExpectation = getExpectation();

for (const path in resultTests) {
const { passed, failed, testSucceeded } = resultTests[path];
for (const result of Object.values(resultTests)) {
Copy link
Member

Choose a reason for hiding this comment

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

Does that mean that deno lint will now warn on all usage of for ... in ... in user code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No. The guard-for-in rule is not tagged recommended and should have no effect unless explicitly enabled.

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

LGTM

@bartlomieju bartlomieju merged commit 6da958d into denoland:main Jan 16, 2023
bartlomieju pushed a commit that referenced this pull request Jan 16, 2023
Updated third_party dlint to v0.37.0 for GitHub Actions. This PR
includes following changes:
 
* fix(prefer-primordials): Stop using array pattern assignments
* fix(prefer-primordials): Stop using global intrinsics except for
`SharedArrayBuffer`
* feat(guard-for-in): Apply new guard-for-in rule
@petamoriken petamoriken deleted the update/dlint branch January 17, 2023 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants