Closed samreid closed 8 years ago
Thanks for your upvote @pixelzoom, I committed the rule to .eslintrc. @jessegreenberg @aaronsamuel137 @jonathanolson @jbphet @phetsims/aadish can you please help standardize the string vars using this lint output?
We've been making decisions like this to clean things up, and they are not getting done. Other examples include visibility annotations, fleshing out JSdoc, and namespacing.
It would be great if we could formalize some of these issues in eslint rules to make it easier to remember and check.
Since this is in master and we are going to share the burden of fixing the outstanding issues, I'll unassign.
Let's add a 'developer-meeting' label so we can check in on the status of this.
Here's a check list of repos that are currently failing this rule:
There are some cases in Molecule Shapes where it would be nice to allow ignoring a prefix, like for 'control.showLonePairs', I had showLonePairsString (ignoring the control). controlShowLonePairsString (and the equivalents are a bit harder to read).
I'm moving over the usages to match the linter, but just thought I'd mention as an improvement.
@jonathanolson wrote:
There are some cases in Molecule Shapes where it would be nice to allow ignoring a prefix
When we were discussing this, I mentioned that case in https://github.com/phetsims/chipper/issues/396#issuecomment-152583394, and asked for input from other developers. But I'm afraid that train has left the station, and I've already changed numerous cases just like this. So I think we should stick with the "no exceptions" rule.
So I think we should stick with the "no exceptions" rule.
Ok, sounds good. Committed above, continuing for other sims.
I should also mention that if/when exceptions become necessary, they can be applied with
// eslint-disable-line [rule-name]
I've updated my associated sims and a few older easy ones.
I knocked off rutherford-scattering.
At developer meeting, let's put names next to remaining repos in https://github.com/phetsims/chipper/issues/396#issuecomment-154550443.
@jessegreenberg capacitor-lab-basics is still failing.
Thanks @pixelzoom, just pushed a fix.
@jbphet and @samreid, I took care of a number of your sims, see check list.
I created individual issues for the 6 remaining sims that are failing ESLint.
Closing this issue.
During the Bending Light code review, @jessegreenberg pointed out several lines in Bending Light where there was a mismatch between the string key and the var declared in the require statement. For instance:
and
I wrote a eslint rule that requires the the following to be true:
varName+'String' === keyName
.Here is the code for the rule: