-
Notifications
You must be signed in to change notification settings - Fork 2
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
What to do about static get
in es6 classes
#983
Comments
Right, those look like good candidates to move to static properties as described in phetsims/wave-interference#281. Once babel supports static attributes, they can be moved back. |
Sounds good I'll convert usages. |
It seems like this should be added to a lint rule, perhaps " static get " is now bad text in sims. Would you like me to add this @samreid? |
Yes please. |
I can start with this patch next time I work on it:
|
Implemented above, and the lint rule was added to the sim specific bad text. @samreid please review. |
Looks great to me, my only question was about the leading whitespace before 'static'. Does eliminating the whitespace introduce any false positives? The leading whitespace seems to be relying on our nesting and formatting conventions. |
No false positives or anything. I thought about it, but it seems the most complete to me. Also note that I'm pretty sure this will only ever be within a class declaration and scope. What do you think is best? I don't want a false positive on "what an ecstatic get he is." :) |
That sounds reasonable, thanks for adding this! Closing. |
It seems useful to have static get, AND it doesn't seem like we're transpiling classes now. Can we have this? Display's |
Yes, we decided this over in #1048 (comment). I will remove the lint rule. I just haven't gotten to it. Closing, please see that issue. |
I see 10 usages of
static get
in our code (Input.js and Client.js). Likely all from me. After talking with @samreid about it, and looking at phetsims/phet-info#82 (comment) and phetsims/wave-interference#281 it seems like we don't want to put attributes on classes this way. @samreid said it has to do with babel.Should these usages be converted? Do we allow
static
getters?The text was updated successfully, but these errors were encountered: