-
Notifications
You must be signed in to change notification settings - Fork 47.4k
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
Enable no-use-before-define rule #13606
Conversation
@@ -37,6 +37,7 @@ module.exports = { | |||
'no-shadow': ERROR, | |||
'no-unused-expressions': ERROR, | |||
'no-unused-vars': [ERROR, {args: 'none'}], | |||
'no-use-before-define': [ERROR, {functions: false, variables: false}], |
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.
Naming of these options is confusing. It basically means "still allow to rely on function hoisting, and don't complain about variables unless they are in the same scope".
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.
Naming of these options is confusing. It basically means "still allow to rely on function hoisting, and don't complain about variables unless they are in the same scope".
If .eslintrc.js
is a .js
would it make sense to put this explanation in a comment next to the added option?
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.
Maybe, but then we almost never change the config so I don't think it's that helpful. Can always blame to a PR if necessary.
Details of bundled changes.Comparing: 8a8d973...7e52e2f schedule
Generated by 🚫 dangerJS |
This would have caught #13582 (comment).
For now, I had to add suppressions for cyclical Flow references but we can remove this after babel/babel-eslint#584 is merged and released.
I also enabled it for classes. Maybe this is excessive but I figured it doesn't hurt since classes aren't hoisted. I had to reorder two places because of that but it's just copy paste.