JSLint

本頁使用了標題或全文手工轉換
維基百科,自由的百科全書
JSLint
原作者道格拉斯·克羅克福特
開發者道格拉斯·克羅克福特
首次發佈2002年,​22年前​(2002
目前版本
  • 2022.3.30 (2022年3月30日;穩定版本)[1]
編輯維基數據連結
原始碼庫 編輯維基數據連結
程式語言JavaScript
作業系統跨平臺
語言英文
類型靜態程式分析
許可協定Unlicense英語Unlicense
網站www.jslint.com

JSLint是一個在軟件開發中確認JavaScript原始碼代碼風格靜態程式分析,可透過網絡應用程式jslint.com及命令列介面來進行分析[2],由道格拉斯·克羅克福特於2002年建立[3]

授權條款[編輯]

JSLint曾使用由MIT許可證衍伸而來的JSLint許可證[4][5],兩者的差別在於JSLint許可證多出了一句話"The Software shall be used for Good, not Evil."。

根據自由軟件基金會的說法,該條款使JSLint變相成為專有軟件[6]。此條款同時阻止了JSLint相關的軟件寄存在Google Code[5],也阻止了Debian自由軟件儲存庫綑綁JSLint[7]。根據Crockford的說法,基於此一限制,IBM在2011年向Crockford申請了惡作劇用的許可證,以便其客戶可以使用JSLint[8][9][10]

2021年起,JSLint改使用自由軟件基金會開放原始碼促進會批准的Unlicense英語Unlicense許可證。

影響[編輯]

多數人認為JSLint是第一個JavaScript語法剖析器,並激發了往後其他類似工具的誕生[11][12]

2011年,Anton Kovalyov創建了一個分支,並命名為JSHint[13][14][15]。作者解釋,創建JSHint的原因是想為開發人員提供一種「不那麼執著」和「更容易組態」的方式來分析代碼[16][17][18]

2013年,Nicholas C. Zakas創建了ESLint[12]。作者解釋,由於JSLint和JSHint都無法創建額外的編程規範英語Coding conventions代碼風格規則,在為JSHint做出貢獻後,Zakas決定創建一個新的語法剖析器。ESLint所有規則都是可組態的,並且可以在執行期定義或載入其他規則[19]。同時,ESLint還支援分析最新版本的JavaScript,即ECMAScript 2015及更高版本。

2014年,Marat Dulin創建了「JSCS」[20]。2016年,JSCS團隊併入了ESLint項目,同時停止JSCS工具的維護[21][22][23]

2015年,SitePoint英語SitePoint發佈了一項對ESLint、JSLint、JSHint和JSCS四個項目的比較,其結果為ESLint優於其他三個語法剖析器[24]。2016年,CodeKit還稱讚ESLint「發現了更多問題」、「可組態性更高」以及成為JavaScript語法剖析器的「行業標準」[11]

2016年,Palantir Technologies建立了TSLint[25],即TypeScript專用的ESLint[26]。2019年,TSLint併入ESLint,成為ESLint的外掛程式typescript-eslint[27][28]

參見[編輯]

參考文獻[編輯]

  1. ^ https://github.com/jslint-org/jslint/releases/tag/v2022.3.30.
  2. ^ JSLint from the Command Line. www.hacksparrow.com. January 2013 [2018-02-26]. (原始內容存檔於2018-02-27). 
  3. ^ first commit. GitHub. 2010-11-12 [2018-02-25]. (原始內容存檔於2021-04-13). Copyright 2002 Douglas Crockford. All Rights Reserved Wrrrldwide and Beyond! 
  4. ^ JSLint source file, including license. [2022-07-12]. (原始內容存檔於2013-06-09). 
  5. ^ 5.0 5.1 JSMin isn't welcome on Google Code. wonko.com. Ryan Grove. 2008-12-08 [2018-02-26]. (原始內容存檔於2023-01-14). 
  6. ^ Various Licenses and Comments About Them. Free Software Foundation. [2022-07-12]. (原始內容存檔於2010-07-24). 
  7. ^ Re: The Software shall be used for Good, not Evil.. www.mail-archive.com. [2022-07-12]. (原始內容存檔於2022-12-05). 
  8. ^ IBM and its minions .... Hasen Judy. 2011-02-13 [2018-02-26]. (原始內容存檔於2013-02-03). 
  9. ^ Douglas Crockford: The JSON Saga. YouTube. 2011-08-11 [2018-02-25]. (原始內容存檔於2021-12-15). I give permission for IBM, its customers, partners, and minions, to use JSLint for evil. 
  10. ^ The JSON Saga by Douglas Crockford
  11. ^ 11.0 11.1 Help: JSLint. codekitapp.com. 2016-12-10 [2018-02-25]. (原始內容存檔於2018-02-26). JSLint is the original JavaScript syntax checker. 
  12. ^ 12.0 12.1 Zakas, Nicholas C. Introducing ESLint. nczonline.net. 16 July 2013 [2018-02-26]. (原始內容存檔於2018-02-26). JSLint was the state of the art in JavaScript linting technology 
  13. ^ Why I forked JSLint to JSHint. anton.kovalyov.net. Anton Kovalyov. 2011-02-20 [2018-02-26]. (原始內容存檔於2011-02-24). [JSLint] has gotten uncomfortably opinionated 
  14. ^ JSHint: A Community Driven Fork of JSLint. badassjs.com. Devon Govett. 18 February 2011 [2011-02-21]. (原始內容存檔於21 February 2011). [..] JSLint was getting a bit too opinionated [..] 
  15. ^ Help: JSHint. codekitapp.com. 2018-02-26 [2018-02-26]. (原始內容存檔於2018-02-26). designed to be less opinionated and more configurable 
  16. ^ Elliot, Ian. JSHint - the (gentler) JavaScript code quality tool. www.i-programmer.info. 21 February 2011 [2018-02-26]. (原始內容存檔於2011-02-23). 
  17. ^ Zakas, Nicholas C. Tweet from Nicholas C. Zakas (@slicknet), creator of ESLint. Twitter. 18 December 2017 [2018-02-26]. (原始內容存檔於2022-07-08). JSLint complaint: not configurable enough. JSHint complaint: still not configurable enough [..] 
  18. ^ JSLint vs JSHint. Scott Logic英語Scott Logic. [2018-02-26]. (原始內容存檔於2018-02-26). 
  19. ^ Understanding the Real Advantages of Using ESLint. Rangle.io Blog. 2015-03-26 [2018-02-26]. (原始內容存檔於2019-02-09). 
  20. ^ Dulin (@mdevils), Marat. JSCS: JavaScript Code Style — Frontend Babel. frontendbabel.info. 21 April 2014 [2018-02-26]. (原始內容存檔於2021-10-18). 
  21. ^ Welcoming JSCS To ESLint. ESLint - Pluggable JavaScript linter. [2018-02-26]. (原始內容存檔於2022-12-07). 
  22. ^ JSCS End of Life. ESLint - Pluggable JavaScript linter. [2018-02-26]. (原始內容存檔於2022-11-28). 
  23. ^ Future of Typescript Linting. ESLint. [2022-07-12]. (原始內容存檔於2021-04-13). 
  24. ^ Hartikainen, Jani. A Comparison of JavaScript Linting Tools. SitePoint. 2015-03-05 [2018-02-26]. (原始內容存檔於2022-12-05). 
  25. ^ tslint. npm. [2022-07-12]. (原始內容存檔於2023-01-02). 
  26. ^ TSLint. palantir.github.io. [2022-07-12]. (原始內容存檔於2022-12-21). 
  27. ^ TSLint in 2019. Medium. June 5, 2019. 
  28. ^ Roadmap: TSLint -> ESLint · Issue #4534 · palantir/tslint. GitHub. [2022-08-15]. (原始內容存檔於2023-01-16). 

延伸閱讀[編輯]

外部連結[編輯]