-
Notifications
You must be signed in to change notification settings - Fork 212
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
allow use before define #9361
allow use before define #9361
Conversation
Deploying agoric-sdk with Cloudflare Pages
|
We haven't removed all use of https://github.com/Agoric/agoric-sdk/blob/master/packages/SwingSet/src/controller/controller.js agoric-sdk/packages/vats/src/crc.js Line 16 in e4a6095
etc. I don't think we even have a lint rule to avoid it. |
Good point. But as you also point out this rule doesn't pertain to those. Any reason to keep this rule? |
use-before-defined does apply to functions, IIUC. What I meant was: we don't have a rule to say "use |
7ad4373
to
c4d7f8d
Compare
6f1744c
to
31d3f7d
Compare
31d3f7d
to
b4fde93
Compare
b4fde93
to
6b8ff51
Compare
I support this change even if we don’t fully migrate from |
Does this mean I can go back to writing code top-down? oh my. whee! |
I don't have a problem with these changes to our coding style.
Is use of |
As suggested, #10464 would now globally suppress no-constant-condition, by borrowing that portion of this PR. |
6b8ff51
to
f1f96ad
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As agreed verbally. LGTM, thanks!
f1f96ad
to
b05fc01
Compare
deb29e7
to
1ceed0f
Compare
1ceed0f
to
babf0ea
Compare
no ticket
Description
The no-use-before-define rule was motivated by when variables could hoist up in surprising ways. We always use
let
andconst
which have the Temporal Dead Zone that will throw an error if used before declaration.So we don't need this rule anymore and it's mostly noise.
This also removes
no-constant-condition
.Whenever someone wants the rule they can still opt in,
Security Considerations
n/a, lint
Scaling Considerations
n/a, lint
Documentation Considerations
reduces need for docs
Testing Considerations
CI
Upgrade Considerations
n/a, lint