Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

metalsmith-jslint

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

metalsmith-jslint

A JSLint plugin for Metalsmith.

  • 0.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
increased by150%
Maintainers
1
Weekly downloads
 
Created
Source

metalsmith-jslint

Build Status

A JSLint plugin for Metalsmith.

Getting Started

If you haven't checked out Metalsmith before, head over to their website and check out the documentation.

Installation

Metalsmith-jslint is available via npm. Simply install it and require it in your application.

npm install --save metalsmith-jslint

Usage

To use jslint inside your Metalsmith application, you just add the function to your build steps via the use method.

var Metalsmith = require('metalsmith'),
    jslint = require('metalsmith-jslint');

Metalsmith(__dirname)
  .use(jslint()) // <-- boom!
  .build();

Notice that you need to actually invoke the function inside the .use method. This is because you can also pass options to JSLint to customize it!

Options

You can also pass a configuration object into the jslint function to change it's behavior. A full list of options is available below:

Metalsmith(__dirname)
  .use(jslint({
    failOnError: true
  })
  .build();
failOnError

Throw an exception if any lint is found. You can either have this halt your build process, or handle the error more directly inside the Metalsmith's .build callback.

Linter Options

The best way to control the linter settings for your project, is by adding a .jslintrc file at the root of your project. JSLint will automatically detect that file and parse the options when linting your code.

For a list of options and command-line flags, check JSLint.com.

Here is an example .jslintrc file:

{
  "color": true,
  "indent": 2
}

You may also options via the command-line, when you run your Metalsmith file:

node --color --indent=2 ./build.js

Credits

Thanks to Segment.io for creating and open-sourcing Metalsmith!

Also thanks to Reid Burke for his library, node-jslint, on which this library is built.

Keywords

FAQs

Package last updated on 09 Mar 2014

Did you know?

Socket

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc