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

var vs let vs const, oh my! #46

Closed
pdehaan opened this issue Feb 12, 2018 · 6 comments
Closed

var vs let vs const, oh my! #46

pdehaan opened this issue Feb 12, 2018 · 6 comments

Comments

@pdehaan
Copy link
Collaborator

pdehaan commented Feb 12, 2018

We have arguments against const and arguments for const, let's have a 🔪 and 🔫 fight and settle this once and for all and see if we can find an ESLint rule that will support whatever we go with.

So this is a "needs discussion" but now shouldn't be a blocker on the current open PR.

@groovecoder
Copy link
Member

If only one of them can be enforced via eslint that will probably make up my mind. @pdehaan do you know if eslint can support one of these and not the other?

@nhnt11
Copy link
Contributor

nhnt11 commented Feb 13, 2018 via email

@pdehaan
Copy link
Collaborator Author

pdehaan commented Feb 13, 2018

Only one I'm aware of is prefer-const, which will try and make everything a const if it is never reassigned. Plus, it will try and make every for..in and for..of loop a const (which isn't a problem, but IIRC Firefox had a bug about that a long time ago, although is a Node-only app for now). Although we could override specific instances by littering // eslint-disable-next-line prefer-const if we wanted.

@pdehaan
Copy link
Collaborator Author

pdehaan commented Feb 13, 2018

@nhnt11 I enabled prefer-const in #47 PR, but then stupidly threw a bunch of other unrelated tweaks in the PR while I was at it.

@pdehaan
Copy link
Collaborator Author

pdehaan commented Mar 5, 2018

Does anybody have any mild/strong objections to our current let vs const decisions, or can we close this issue?

@nhnt11
Copy link
Contributor

nhnt11 commented Mar 7, 2018

Let's close this.

@nhnt11 nhnt11 closed this as completed Mar 7, 2018
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

No branches or pull requests

3 participants