Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
grunt-jslint
Advanced tools
Validates JavaScript files with JSLint as a grunt task.
Install this grunt plugin next to your project's Gruntfile with: npm install grunt-jslint
Then add this line to your project's gruntfile:
grunt.loadNpmTasks('grunt-jslint');
A multi-task to validate your JavaScript files with JSLint.
Supports the following options:
predef: ['myglobal']
true
true
; when set to false
, grunt will not fail if JSLint detects an error#!/usr/bin/whatever
) from filesmodule.exports = function (grunt) {
'use strict';
grunt.loadNpmTasks('grunt-jslint'); // load the task
grunt.initConfig({
jslint: { // configure the task
// lint your project's server code
server: {
src: [ // some example files
'server/lib/*.js',
'server/routes/*.js',
'server/*.js',
'server/test/*.js'
],
exclude: [
'server/config.js'
],
directives: { // example directives
node: true,
todo: true
},
options: {
junit: 'out/server-junit.xml', // write the output to a JUnit XML
log: 'out/server-lint.log',
jslintXml: 'out/server-jslint.xml',
errorsOnly: true, // only display errors
failOnError: false, // defaults to true
checkstyle: 'out/server-checkstyle.xml' // write a checkstyle-XML
}
},
// lint your project's client code
client: {
src: [
'client/**/*.js'
],
directives: {
browser: true,
predef: [
'jQuery'
]
},
options: {
junit: 'out/client-junit.xml'
}
}
}
});
grunt.registerTask('default', 'jslint');
};
All files should be validated with JSLint. Bug fixes and/or new features must be accompanied by a passing test. Tests are written with vows.
Run grunt jslint
in the root of your repository.
Run make test
in the root of your repository.
Copyright (c) 2013 Stephen Mathieson Licensed under the WTFPL license.
FAQs
Validates JavaScript files with JSLint
The npm package grunt-jslint receives a total of 741 weekly downloads. As such, grunt-jslint popularity was classified as not popular.
We found that grunt-jslint demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
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.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.