Enable no-use-before-define rule#13606
Merged
gaearon merged 1 commit intofacebook:masterfrom Sep 10, 2018
Merged
Conversation
gaearon
commented
Sep 9, 2018
| 'no-shadow': ERROR, | ||
| 'no-unused-expressions': ERROR, | ||
| 'no-unused-vars': [ERROR, {args: 'none'}], | ||
| 'no-use-before-define': [ERROR, {functions: false, variables: false}], |
Collaborator
Author
There was a problem hiding this comment.
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".
Contributor
There was a problem hiding this comment.
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?
Collaborator
Author
There was a problem hiding this comment.
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 |
Simek
pushed a commit
to Simek/react
that referenced
this pull request
Oct 25, 2018
jetoneza
pushed a commit
to jetoneza/react
that referenced
this pull request
Jan 23, 2019
NMinhNguyen
referenced
this pull request
in enzymejs/react-shallow-renderer
Jan 29, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.