Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
grunt-jslint
Advanced tools
Validates JavaScript files with JSLint as a grunt task.
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');
A single-task to validate your JavaScript files with JSLint.
Supports the following options:
<li>
<b>exclude</b> - A String/filepath/wildcard option which, when provided, tells the plugin which files should be ignored (not scanned).
</li>
<li>
<b>directives</b> - Configuration options/settings to pre-define in JSLint. Pre-defined globals are included within this object as <code>predef: ['myglobal']</code>
</li>
<li>
<b>Options</b> - Configuration options/settings for the plugin itself. Currently supports the following:
<ul>
<li>
<b>errorsOnly</b> - A Boolean option which tells the plugin to only display errors when set to <code>true</code>.
</li>
<li>
<b>log</b> - A String/filepath option which, when provided, tells the plugin where to write a verbose log to.
</li>
<li>
<b>junit</b> - A String/filepath option which, when provided, tells the plugin where to write a JUnit-style XML file to.
</li>
<li>
<b>jslintXml</b> - A String/filepath option which, when provided, tells the plugin where to write a JSLint-style XML file to.
</li>
</ul>
</li>
/*jslint node:true*/
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'
],
exclude: [
'**/ignore-*.js',
'bananas.js'
],
directives: { // example directives
browser: true,
unparam: true,
todo: true,
predef: [ // array of pre-defined globals
'jQuery'
]
},
options: {
junit: 'out/junit.xml', // write the output to a JUnit XML
log: 'out/lint.log',
jslintXml: 'out/jslint_xml.xml',
errorsOnly: true // only display errors
}
}
});
grunt.registerTask('default', 'watch');
};
grunt.js
file for you - moved all options into the jslint
objectCopyright (c) 2012 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
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.