Gulp Pattern Lint
When Grunt came along, it really changed the way I set up all my projects as a front-end developer. Instead of sometimes having a Compass project or sometimes having a Jekyll project, everything became a Grunt project. Instead of relying on my own workflow for things like JSHint settings and text-editor preferences, I started setting up all those specifications on a project level. Rather than relying on globally installed ruby gems, I began relying on getting everything I needed for a project by typing
npm install in a project’s directory. Instead of relying on someone else’s framework, I felt like I was assembling a different toolkit for each project, uniquely suited to the task at hand.
So when Dave sidled up to me at work one day and said, “So, I think we should use Gulp instead of Grunt,” I didn’t react very well. I may have given him a dead-eyed stare and said, “What in the name of Thoth are you talking about?” “It uses streams!” Dave said. “And pipes!” I wasn’t impressed. Streams have to be forded, or you have to caulk the wagon and float across, and usually somebody in the party dies. And pipes are exclusively transportation for Mario brothers. But when my buddy Andrew posted a comparison of one project’s Gruntfile vs. the new Gulpfile he’d made for it, I had to reluctantly concede that the Gulpfile was a lot easier to read.
So, fortunately and unfortunately, I abandoned Grunt. I’m pretty sad about that, by the way. Ben Alman created one of the most insanely useful and popular things ever, and suddenly the next thing comes along and Grunt is just over. Every front-end developer I know is switching. The world moves so quickly. Grunt: you will always hold a place in my heart. You changed the way I work.
Enough of this bland storytelling: I created my first gulp plugin, recently, in response to a need we had at work to flag certain bad practices in CMS plugins. Pattern Lint is a linter that works on any kind of file that searches the content for patterns (strings or regular expressions) and flags them, if found, outputting a custom message to your gulp process. We’re using it to warn people not to use
http:// links, the wrong form of our CDN url, or vendor prefixes in their CSS file (because the autoprefixer plugin takes care of that).