0.1.2 • Published 9 years ago

lint-templates v0.1.2

Weekly downloads
47
License
MIT
Repository
github
Last release
9 years ago

lint-templates NPM version

Finds helpers that aren't registered and variabled that aren't defined on the context. Can be used as a middleware with assemble, Template, verb, generate, and other apps built on Template.

Install

Install with npm

$ npm i lint-templates --save

Usage

var lint = require('lint-templates');

Middleware

Use as a middleware with Template or Template-based applications, like assemble, verb, or generate.

var lint = require('lint-templates');

module.exports = function (app) {
  return function(file, next) {
    lint(app, file);
    next();
  };
};

Register the middleware:

template.onLoad(/\.hbs/, lint(app));

Any of the following middleware VERBs should work:

  • .onLoad
  • .preRender
  • .preCompile
  • .use
  • .all

Any of these "stages" might give you useful information depending how your project is setup.

Related projects

  • assemble: Static site generator for Grunt.js, Yeoman and Node.js. Used by Zurb Foundation, Zurb Ink, H5BP/Effeckt,… more
  • rethrow: Re-throw an error to get better error reporting for templates.
  • template: Render templates using any engine. Supports, layouts, pages, partials and custom template types. Use template… more
  • verb: Documentation generator for GitHub projects. Extremely powerful, easy to use, can generate anything from API… more

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Author

Jon Schlinkert

License

Copyright © 2015 Jon Schlinkert Released under the MIT license.


This file was generated by verb-cli on May 24, 2015.