Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upDefining a variable to itself that is undefined raises no errors #615
Comments
This comment has been minimized.
This comment has been minimized.
not-an-aardvark
commented
Sep 7, 2016
|
Relevant ESLint rule: |
This comment has been minimized.
This comment has been minimized.
|
Good catch. We could try enabling the following rule:
Even with the most lax options to
If eslint adds an option that doesn't flag the following as invalid, then we can do this. Otherwise, it's just too disruptive to valid code. function myFn () {
// Variable "a" is not necessarily used before it is defined
console.log(a)
}
var a = 5 |
This comment has been minimized.
This comment has been minimized.
|
I opened an issue on eslint to add the necessary option: eslint/eslint#7111 |
feross
added
blocked
enhancement
labels
Sep 10, 2016
feross
modified the milestone:
standard v9
Sep 11, 2016
feross
removed
the
blocked
label
Feb 4, 2017
This comment has been minimized.
This comment has been minimized.
|
Duplicate of #636 |
feross
closed this
Feb 9, 2017
This comment has been minimized.
This comment has been minimized.
|
(Btw, this will be part of standard v9.) |
feross
added a commit
to standard/eslint-config-standard
that referenced
this issue
Feb 9, 2017
feross
added a commit
to standard/eslint-config-standard
that referenced
this issue
Feb 9, 2017
lock
bot
locked as resolved and limited conversation to collaborators
May 10, 2018
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
pinn3 commentedSep 7, 2016
Example: