Socket
Socket
Sign inDemoInstall

lint-templates

Package Overview
Dependencies
18
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    lint-templates

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


Version published
Maintainers
1
Install size
122 kB
Created

Readme

Source

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.

  • 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.

FAQs

Last updated on 24 May 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc