Skip to content
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

Add GreenSock-JS globals? #2336

Closed
stevemao opened this issue Apr 23, 2015 · 3 comments
Closed

Add GreenSock-JS globals? #2336

stevemao opened this issue Apr 23, 2015 · 3 comments
Labels

Comments

@stevemao
Copy link
Contributor

Hi I'm currently working with GreenSock-JS (https://github.com/greensock/GreenSock-JS) and they have a bunch of globals (http://greensock.com/forums/topic/11369-gsap-globals-for-jshint/)

"globals": {
        //GSAP Globals
        "TimelineLite" : false,
        "TimelineMax" : false,
        "TweenLite" : false,
        "TweenMax" : false,
        "Back" : false,
        "Bounce" : false,
        "Circ" : false,
        "Cubic" : false,
        "Ease" : false,
        "EaseLookup" : false,
        "Elastic" : false,
        "Expo" : false,
        "Linear" : false,
        "Power0" : false,
        "Power1" : false,
        "Power2" : false,
        "Power3" : false,
        "Power3" : false,
        "Power4" : false,
        "Quad" : false,
        "Quart" : false,
        "Quint" : false,
        "RoughEase" : false,
        "Sine" : false,
        "SlowMo" : false,
        "SteppedEase" : false,
        "Strong" : false,
        "Draggable" : false,
        "SplitText" : false,
        "VelocityTracker" : false, 
        "CSSPlugin" : false,
        "ThrowPropsPlugin" : false, 
        "BezierPlugin" : false
}

I wish I could just write

GSAP: true
@jugglinmike
Copy link
Member

Accepting library-specific globals is a slippery slope of supporting all sorts of lesser-used libraries. Instead of trying to define which libraries are "popular enough" to justify inclusion, we're reserving new environment settings for true environments.

The GreenSock library might consider exporting a single variable on the global scope and using that as a namespace for its API. I only suggest changing the source code (instead of JSHint) in this case because the change would do more than address this specific problem (making linting configuration easier to manage). It's generally considered a best practice because it minimizes risk of collisions and it requires consuming code to be easier to follow (the origin of every method is communicated each time it is accessed).

@stevemao
Copy link
Contributor Author

I can't agree more :D

@jugglinmike
Copy link
Member

Thanks for understanding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants