I’ve found what appears to be an awesome bit of WebGL code for my website. I honestly spent only an hour tweaking the demo code so that it looks amazing. It’s got 3D movement, perspective, animation and very realistic-looking physics. The only major problem now is shimming it into my Polymer Elements website, somehow getting all this past Lint‘s watchful eye.
You might be wondering why I might have added this to my project in the first place. I suppose the honest answer would be: I didn’t. The
gulpfile.js in this project builds everything so that only a fraction of the code is then published to the website. I suppose this is “best practices” if you’re a big company like Google and you want to obfuscate your HTML source as much as possible. And Lint is just part of that build process which I inherited by using the Polymer template code.
If you’ve never seen a
gulpfile.js and have never used gulp before you might try getting your feet wet by trying a project using Polymer Elements by Google. You can process the build by simply running
gulp or something more sophisticated like building and then serving up your website locally with
gulp serve, for example.
I’ve just spent two long sprints of coding work trying to get three files past Lint.
The next file is glUtils.js and appears to be something to augment the Sylvester library. And I just spent three hours working with Lint trying to get this one to stop complaining.
And the last file is WebGL.js and appears to be the work of the demo author himself. I’ve just spent over four hours editing this one to make Lint happy.
Nine hours hacking away at other people’s code and I’m still not finished yet. Lint is still complaining about a variety of things and I haven’t even actually added the code to my project other than dropping the files into the scripts folder.
I’m left with a decision to make.
- Do I abandon Lint’s review of these three files by filtering them from the appropriate section of the
- Do I research Lint to find out how to tell it to ignore the offending section(s) of code so that it thinks it’s happy?
- Do I abandon the demo code idea completely and not bring it into my project?
- Do I abandon the Lint step completely from the build process itself?
I don’t know at this point. I do know that I’m tired of doing this, though.
Secondly, what would be nice would be if github had a built-in checker which could indicate a Lint rating, say, for anything in the repository. Or possibly, it might be a flag style of attribute. Regardless, if you were considering bringing in some code you could have an early warning that you might spend literally days having to update it.