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

grunt-jslint

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-jslint

Validates JavaScript files with JSLint

  • 0.1.8
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
908
decreased by-16.85%
Maintainers
1
Weekly downloads
 
Created
Source

grunt-jslint

Validates JavaScript files with JSLint as a grunt task.

Installation

Install this grunt plugin next to your project's grunt.js gruntfile with: npm install grunt-jslint

Then add this line to your project's grunt.js gruntfile:

grunt.loadNpmTasks('grunt-jslint');

Documentation

jslint

The multitask, responsible for running JSLint. The task accepts a single option (property), files.

The files property is an array of files or wildcards which you want to be validated with JSLint.

jslint_directives

Configuration options/settings to pre-define in JSLint.

Sample directives:

browser: true,
unparam: true,
predef: [ // functionally the same thing as /*global myGlobal:true, anotherGlobal:true*/
	'myGlobal',
	'anotherGlobal'
]

jslint_options

Configuration options/settings for the plugin itself.

Currently supported options include:

  • errorsOnly - A Boolean option which tells the plugin to only display errors when set to true.
  • log - A String/filepath option which, when provided, tells the plugin where to write a verbose log to.
  • junit - A String/filepath option which, when provided, tells the plugin where to write a JUnit-style XML file to.
  • exclude - A String/filepath/wildcard option which, when provided, tells the plugin which files should be ignored (not scanned).

Example Usage

module.exports = function (grunt) {

	'use strict';

	grunt.loadNpmTasks('grunt-jslint'); // load the task

	grunt.initConfig({
		watch: {
			files: '<config:jslint.files>',
			tasks: 'jslint'
		},

		jslint: { // configure the task
			files: [ // some example files
				'grunt.js',
				'src/**/*.js'
			]
		},

		jslint_directives: { // example directives
			browser: true,
			unparam: true,
			todo: true,
			predef: [ // array of pre-defined globals
				'jQuery'
			]
		},

		jslint_options: {
			junit: 'out/junit.xml', // write the output to a JUnit XML
			log: 'out/lint.log',
			errorsOnly: true // only display errors
		}

	});

	grunt.registerTask('default', 'server watch');
};

Release History

  • 0.1.8 - Updating README.md to contain more verbose documentation, adding keywords to package.json
  • 0.1.7 - Added an option to only report on errors
  • 0.1.6 - Added an exclude option and added number of files in violation to standard output.

License

Copyright (c) 2012 Stephen Mathieson Licensed under the WTFPL license.

Keywords

FAQs

Package last updated on 03 Oct 2012

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