JSLint

{{short description|JavaScript static code analysis tool}}

{{Infobox software

| logo = 128px

| name = JSLint

| title = JSLint

| author = Douglas Crockford

| developer = Douglas Crockford, Kai Zhu

| released = {{Start date and age|2002}}

| latest release version = {{wikidata|property|reference|edit|P348}}

| latest release date = {{Start date and age|{{wikidata|qualifier|P348|P577}}}}

| programming language = JavaScript

| operating system = Cross-platform

| language = English

| genre = Static code analysis

| license = Unlicense

| website = {{URL|https://www.jslint.com}}

}}

JSLint is a static code analysis tool used in software development for checking if JavaScript source code complies with coding rules. It is provided primarily as a browser-based web application accessible through the domain jslint.com, but there are also command-line adaptations.{{Cite web|url=https://www.hacksparrow.com/jslint-from-the-command-line.html|title=JSLint from the Command Line|date=January 2013|website=www.hacksparrow.com|access-date=2018-02-26|archive-date=2018-02-27|archive-url=https://web.archive.org/web/20180227034307/https://www.hacksparrow.com/jslint-from-the-command-line.html|url-status=dead}} It was created in 2002 by Douglas Crockford.{{Cite web|url=https://github.com/douglascrockford/JSLint/commit/ca120a731db548c0014320fa0c196edc613536ae|title=first commit|date=2010-11-12|website=GitHub|access-date=2018-02-25|quote=Copyright 2002 Douglas Crockford. All Rights Reserved Wrrrldwide and Beyond!}}

License

Since 2021, JSLint uses the FSF / OSI approved Unlicense license.

Before that, the JSLint license{{Cite web|url=https://raw.github.com/douglascrockford/JSLint/master/jslint.js|title=JSLint source file, including license|access-date=2011-11-22|archive-date=2013-06-09|archive-url=https://web.archive.org/web/20130609144601/https://raw.github.com/douglascrockford/JSLint/master/jslint.js|url-status=dead}} was a derivative of the MIT License.{{Cite web|url=http://wonko.com/post/jsmin-isnt-welcome-on-google-code|title=JSMin isn't welcome on Google Code|date=2008-12-08|website=wonko.com|publisher=Ryan Grove|access-date=2018-02-26}} The sole modification was the addition of the line "The Software shall be used for Good, not Evil."

According to the Free Software Foundation, this previous clause made the original license non-free.{{cite web|title=Various Licenses and Comments About Them|url=https://www.gnu.org/licenses/license-list.html#JSON|publisher=Free Software Foundation}} It had also prevented JSLint-related software from being hosted on Google Code and from being included in the Debian free software package repositories.{{Cite web|url=https://www.mail-archive.com/debian-legal@lists.debian.org/msg40718.html|title=Re: The Software shall be used for Good, not Evil.|website=www.mail-archive.com}} Because of this restriction, according to Crockford, IBM asked Crockford in 2011 for a license to do evil, such that their customers could use it.{{Cite web|url=http://dev.hasenj.org/post/3272592502|title=IBM and its minions ...|date=2011-02-13|website=Hasen Judy|archive-url=https://web.archive.org/web/20130203112329/http://dev.hasenj.org/post/3272592502|archive-date=2013-02-03|access-date=2018-02-26

|quote=I give permission for IBM, its customers, partners, and minions, to use JSLint for evil.}}{{Cite web|url=https://www.youtube.com/watch?v=-C-JoyNuQJs#t=2480s |archive-url=https://ghostarchive.org/varchive/youtube/20211215/-C-JoyNuQJs |archive-date=2021-12-15 |url-status=live|title=Douglas Crockford: The JSON Saga|date=2011-08-11|website=YouTube|access-date=2018-02-25|quote="I give permission for IBM, its customers, partners, and minions, to use JSLint for evil."}}{{cbignore}}The JSON Saga by Douglas Crockford

Influence

JSLint is considered by some to be the first JavaScript syntax checker.{{Cite web|url=https://codekitapp.com/help/jslint/|title=Help: JSLint|date=2016-12-10|website=codekitapp.com|archive-url=https://web.archive.org/web/20180226015758/https://codekitapp.com/help/jslint/|archive-date=2018-02-26|url-status=live|access-date=2018-02-25|quote=JSLint is the original JavaScript syntax checker.}}{{Cite web|url=https://www.nczonline.net/blog/2013/07/16/introducing-eslint/|title=Introducing ESLint|last=Zakas|first=Nicholas C.|date=16 July 2013|website=nczonline.net|access-date=2018-02-26|quote=JSLint was the state of the art in JavaScript linting technology|archive-date=2018-02-26|archive-url=https://web.archive.org/web/20180226092246/https://www.nczonline.net/blog/2013/07/16/introducing-eslint/|url-status=dead}} It has since inspired various other tools.

In 2011, Anton Kovalyov created a fork, called JSHint.{{Cite web|url=http://anton.kovalyov.net/2011/02/20/why-i-forked-jslint-to-jshint/|title=Why I forked JSLint to JSHint|date=2011-02-20|website=anton.kovalyov.net|publisher=Anton Kovalyov|archive-url=https://web.archive.org/web/20110224022052/http://anton.kovalyov.net/2011/02/20/why-i-forked-jslint-to-jshint/|archive-date=2011-02-24|access-date=2018-02-26|quote=[JSLint] has gotten uncomfortably opinionated}}{{Cite web|url=http://badassjs.com/post/3364925033/jshint-an-community-driven-fork-of-jslint|title=JSHint: A Community Driven Fork of JSLint|date=18 February 2011|website=badassjs.com|publisher=Devon Govett|archive-url=https://web.archive.org/web/20110221102102/http://badassjs.com/post/3364925033/jshint-an-community-driven-fork-of-jslint|archive-date=21 February 2011|url-status=live|access-date=2011-02-21|quote=[..] JSLint was getting a bit too opinionated [..]}}{{Cite web|url=https://codekitapp.com/help/jshint/|title=Help: JSHint|date=2018-02-26|website=codekitapp.com|access-date=2018-02-26|quote=designed to be less opinionated and more configurable}} The main motivation behind the creation of JSHint was to provide a "less opinionated" and "more configurable" way for developers to analyse code.{{Cite web|url=http://www.i-programmer.info/news/90-tools/2024-jshint-the-gentler-javascript-code-quality-tool.html|title=JSHint - the (gentler) JavaScript code quality tool|last=Elliot|first=Ian|date=21 February 2011|website=www.i-programmer.info|archive-url=https://web.archive.org/web/20110223093520/http://www.i-programmer.info/news/90-tools/2024-jshint-the-gentler-javascript-code-quality-tool.html|archive-date=2011-02-23|url-status=live|access-date=2018-02-26}}{{Cite web|url=https://twitter.com/slicknet/status/942933466944901120|title=Tweet from Nicholas C. Zakas (@slicknet), creator of ESLint|last=Zakas|first=Nicholas C.|date=18 December 2017|website=Twitter|access-date=2018-02-26|quote=JSLint complaint: not configurable enough. JSHint complaint: still not configurable enough [..]}}{{Cite news|url=http://blog.scottlogic.com/2011/03/28/jslint-vs-jshint.html|title=JSLint vs JSHint|work=Scott Logic|access-date=2018-02-26}}

In 2013, Nicholas C. Zakas created ESLint. Both JSLint and JSHint lacked the ability to create additional rules for code quality and coding style. After contributing to JSHint, Zakas decided to create a new linting tool, ESLint, where all rules are configurable, and additional rules can be defined or loaded at run-time.{{Cite news|url=http://blog.rangle.io/understanding-the-real-advantages-of-using-eslint/|title=Understanding the Real Advantages of Using ESLint|date=2015-03-26|work=Rangle.io Blog|access-date=2018-02-26|archive-date=2019-02-09|archive-url=https://web.archive.org/web/20190209232042/https://blog.rangle.io/understanding-the-real-advantages-of-using-eslint/|url-status=dead}} ESLint also supports linting the latest versions of JavaScript, aka ECMAScript 2015 and above.

In 2013, Palantir Technologies created TSLint,{{Cite web|url=https://www.npmjs.com/package/tslint/v/0.1.0|title=tslint v0.1.0|website=npm|date=28 July 2013 }} which was the TypeScript equivalent for ESLint.{{Cite web|url=https://palantir.github.io/tslint/|title=TSLint|website=palantir.github.io}} In 2019 TSLint was deprecated in favor of ESLint with a TypeScript integration.{{Cite web|url=https://blog.palantir.com/tslint-in-2019-1a144c2317a9|title=TSLint in 2019|date=June 5, 2019|website=Medium}}

In 2014, Marat Dulin created JSCS.{{Cite web|url=http://frontendbabel.info/articles/jscs-javascript-code-style/|title=JSCS: JavaScript Code Style — Frontend Babel|last=Dulin (@mdevils)|first=Marat|date=21 April 2014|website=frontendbabel.info|access-date=2018-02-26}} In 2016, the JSCS Team joined the ESLint project and has since discontinued maintenance of the JSCS tool.{{Cite web|url=https://eslint.org/blog/2016/04/welcoming-jscs-to-eslint|title=Welcoming JSCS To ESLint|website=ESLint - Pluggable JavaScript linter|date=14 April 2016 |access-date=2018-02-26}}{{Cite web|url=https://eslint.org/blog/2016/07/jscs-end-of-life|title=JSCS End of Life|website=ESLint - Pluggable JavaScript linter|date=15 July 2016 |access-date=2018-02-26}}{{cite web |title=Future of Typescript Linting |url=https://eslint.org/blog/2019/01/future-typescript-eslint |website=ESLint|date=18 January 2019 }}

In 2015, a comparison published by SitePoint, recommended ESLint above JSLint, JSHint and JSCS.{{Cite news|url=https://www.sitepoint.com/comparison-javascript-linting-tools/|title=A Comparison of JavaScript Linting Tools|last=Hartikainen|first=Jani|date=2015-03-05|work=SitePoint|access-date=2018-02-26}} In 2016, CodeKit also praised ESLint for "finding more issues", being "far more configurable", and being "the industry standard" for JavaScript syntax checkers.

See also

References

{{Reflist}}

Further reading

  • {{Cite journal

| doi = 10.1145/1142958.1142972

| volume = 31

| issue = 4

| pages = 16–24

| last = Doernhoefer

| first = Mark

| title = JavaScript

| journal = SIGSOFT Softw. Eng. Notes

| access-date = 2010-03-12

| year = 2006

| s2cid = 221777701

| url = http://portal.acm.org/citation.cfm?id=1142958.1142972&coll=Portal&dl=ACM&CFID=81676408&CFTOKEN=16664136

| url-access = subscription

}}

  • Appendix C of {{Cite book

| edition = 1

| publisher = O'Reilly Media

| isbn = 978-0-596-51774-8

| last = Crockford

| first = Douglas

| title = JavaScript: The Good Parts

| date = May 2008

| url = https://archive.org/details/javascriptgoodpa00croc_0

}}

  • Section 'Performing JavaScript Syntax Checking with JSLint', Pages 143-145 of {{Cite book

| edition = 1

| publisher = Apress

| isbn = 1-59059-582-3

| last = Asleson

| first = Ryan

| author2 = Nathaniel T. Schutta

| title = Foundations of Ajax

| date = 2005-10-14

| url = https://archive.org/details/isbn_9781590595824

}}