-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Suppress missing require from externs (reworked) #1366
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
Suppress missing require from externs (reworked) #1366
Conversation
@blickly wrote in #1192 (comment)
@MatrixFrog wrote in #1192 (comment)
In fact because this is an ES6 class, the problem was in Line 406 no longer exists, but I think this was This fix was done sympathetically to |
eb4650a
to
d54b644
Compare
This makes sense. I'm surprised I haven't hit this yet. |
Node extendClass = classNode.getSecondChild(); | ||
|
||
// If the superclass is something other than a qualified name, ignore it. |
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.
nit: Make the code structure follow this comment with an early return:
if (!extendClass.isQualifiedName()) {
return;
}
// Grab the root superclass namespace.
Node root = ...
In fact then we can probably drop the comment too.
lgtm other than that. Thank you. |
d54b644
to
7ca9dba
Compare
We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm. |
…, e.g. class MyClass extends React.Component (rework of PR 1192 to match rest of class more closely)
7ca9dba
to
ba46b7d
Compare
CLAs look good, thanks! |
@MatrixFrog Nits done, thanks |
Suppress missing require from externs (reworked)
Thanks! |
Suppress missing require from externs (reworked) Merge pull request #1381 from Dominator008/indent Fix format in CheckRequiresForConstructors.java ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=111879244
This is to fix the case where you have React defined globally in externs:
Without this PR you get the following warning, which is incorrect since externs don't need to be required as they are global:
This is a rework of PR #1192 which follows the behaviour of the rest of the class more closely. The check now happens before adding to usages, in visitClassNode, rather than in visitScriptNode, as per @MatrixFrog comment #1192 (comment)