The JavaScript Code Quality Tool — for Node.js.
Installations
npm install jslint
Developer Guide
Typescript
No
Module System
CommonJS
Min. Node Version
>=0.8.0
Node Version
11.8.0
NPM Version
6.5.0
Score
98
Supply Chain
98.4
Quality
77.4
Maintenance
100
Vulnerability
98.2
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (99.97%)
Makefile (0.03%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
Download Statistics
Total Downloads
16,348,723
Last Day
13,147
Last Week
94,881
Last Month
287,638
Last Year
2,629,865
GitHub Statistics
NOASSERTION License
491 Stars
412 Commits
101 Forks
17 Watchers
8 Branches
32 Contributors
Updated on Jun 12, 2024
Bundle Size
70.16 kB
Minified
23.32 kB
Minified + Gzipped
Package Meta Information
Latest Version
0.12.1
Package Id
jslint@0.12.1
Size
612.24 kB
NPM Version
6.5.0
Node Version
11.8.0
Published on
Jan 29, 2019
Total Downloads
Cumulative downloads
Total Downloads
16,348,723
Last Day
-3.6%
13,147
Compared to previous day
Last Week
37.6%
94,881
Compared to previous week
Last Month
73.9%
287,638
Compared to previous month
Last Year
-37.5%
2,629,865
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
4
Dev Dependencies
4
node-jslint
Easily use JSLint from the command line.
jslint bin/jslint.js
What's New
Added latest jslint, 2018-01-27.
Version 0.12.0 contains the latest jslint-es6
See CHANGELOG.md for detailed change history
Use the command-line client
Install (both local and global are supported)
npm i jslint
Use the default jslint
jslint lib/color.js
Always use the latest jslint
jslint --edition=latest lib/color.js
Use a specific edition
For example, edition 2013-02-03 which shipped with node-jslint 0.1.9:
jslint --edition=2013-02-03 lib/color.js
Use node-jslint programmatically
Streams interface
As of node-jslint 0.4.0, a streams interface is exposed. You can use it in client code like this:
Install as a dependency:
$ npm install --save jslint
Pull it into your code with require:
var LintStream = require('jslint').LintStream;
Create and configure the stream linter:
var options = {
"edition": "latest",
"length": 100
},
l = new LintStream(options);
Send files to the linter:
var fileName, fileContents;
l.write({file: fileName, body: fileContents});
Receive lint from the linter:
l.on('data', function (chunk, encoding, callback) {
// chunk is an object
// chunk.file is whatever you supplied to write (see above)
assert.deepEqual(chunk.file, fileName);
// chunk.linted is an object holding the result from running JSLint
// chunk.linted.ok is the boolean return code from JSLINT()
// chunk.linted.errors is the array of errors, etc.
// see JSLINT for the complete contents of the object
callback();
});
You can only pass options to the LintStream when creating it. The edition
option can be
used to select different editions of JSLint.
The LintStream is in object mode (objectMode: true). It expects an
object with two properties: file
and body
. The file
property
can be used to pass metadata along with the file. The body
property
contains the file to be linted; it can be either a string or a Buffer.
The LintStream emits 'data'
events containing an object with two properties.
The file
property is copied from the file
property that is passed in. The
linted
property contains the results of running JSLINT.
Simple interface
The simple interface provides an edition-aware loader. This can be used as a frontend to node-jslint's collection of editions of the JSLINT code.
var node_jslint = require('jslint'),
JSLINT = node_jslint.load(edition);
This exposes the same loading interface used in node-jslint, so it supports the special
edition names default
and latest
as well as date-based edition names such as 2013-08-26
As of version 0.5.0, the load
function also accepts filenames. To be recognized as a filename,
the argument to load must contain a path-separator character (/
or \
) or end with the extension
.js
.
Usage examples
Multiple files
jslint lib/color.js lib/reporter.js
All JSLint options supported
jslint --white --vars --regexp lib/color.js
Defaults to true, but you can specify false
jslint --bitwise false lib/color.js
Pass arrays
jslint --predef $ --predef Backbone lib/color.js
JSLint your entire project
jslint '**/*.js'
Using JSLint with a config file
Start with the included jslint.conf.example
file, name it jslint.conf
and customize your options
per project or copy it to $HOME/.jslint.conf
to apply your setting globally
License
See LICENSE file.

No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Warn: project license file does not contain an FSF or OSI license.
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/reid/node-jslint/test.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/reid/node-jslint/test.yml/master?enable=pin
- Info: 0 out of 2 GitHub-owned GitHubAction dependencies pinned
- Info: 1 out of 1 npmCommand dependencies pinned
Reason
8 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44
- Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988
- Warn: Project is vulnerable to: GHSA-xf5p-87ch-gxw2
- Warn: Project is vulnerable to: GHSA-5v2h-r2cx-5xgj
- Warn: Project is vulnerable to: GHSA-rrrm-qjm4-v8hf
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m
- Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h
Reason
Found 1/26 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/test.yml:1
- Info: no jobLevel write permissions found
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 16 are checked with a SAST tool
Score
2.8
/10
Last Scanned on 2025-02-10
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to jslint
gulp-jslint
The classic and strict javascript lint-tool for gulp.js
jslint-cli
Command line interface for JSLint, the JavaScript code quality tool
@jkuebart/jslint
Douglas Crockford's JSLint, packaged for Node.js.
jslint-lite
this zero-dependency package will provide browser-compatible versions of jslint (v2020.7.2) and csslint (v2018.2.25), with working web-demo