ESLint

本页使用了标题或全文手工转换
维基百科,自由的百科全书
ESLint
原作者Nicholas C. Zakas
開發者Nicholas C. Zakas
首次发布2013年6月30日,​10年前​(2013-06-30
当前版本
  • 8.57.0 (2024年2月23日;穩定版本)[1]
編輯維基數據鏈接
源代码库 編輯維基數據鏈接
编程语言JavaScript
操作系统跨平台
语言English
类型靜態程式分析
许可协议MIT許可證
网站eslint.org

ESLint用於檢查JavaScript程式碼是否符合規則,由Nicholas C. Zakas在2013年建立。[2][3]ESLint中的規則是可更改的,並且可以自行定義和加載規則。ESLint想要解決關於程式碼品質英语Coding conventions程式碼風格的問題。ESLint支援ECMAScript當前標準以及草案中用於未來標準的實驗語法。使用JSXTypeScript的程式也可以透過外掛或轉譯器處理。[4][5]

歷史

JSLint和JSHint都缺乏為了程式碼品質和程式碼風格新增規則的能力。[3]在為JSHint做出貢獻之後,Zakas決定在2013年6月建立一個新的整理工具ESLint(最初稱為JSCheck,但在一個月後更名),其中所有規則都可更改,並且可以在運行時定義或加載其他規則。[6][7]

2016年4月,ESLint項目加入了jQuery Foundation英语jQuery Foundation[8]隨後,jQuery Foundation與Dojo Foundation合併,成为Linux Foundation其中的JS Foundation英语JS Foundation[9][10][11]

2017年10月,ESLint從JS Foundation的mentorship program畢業。[12]

2019年3月,JS Foundation和Node.js Foundation合併之後成為OpenJS Foundation的一部份。[13][14]

支援

自2015年起,JetBrains於其WebStorm程式碼編輯器中內建支援ESLint,可對當前開啟的文件運行ESLint,並在編輯器中有問題的程式碼附近顯示警告。[15][16][17]

2016年,Vue.js項目提供了一個ESLint外掛來自動驗證Vue.js模板和其他功能的使用。[18][19][20]從2018年開始,Vue CLI建立新Vue.js項目時也會建議使用該外掛。[21]

在2018年10月,React(由Facebook開發)發布了一個官方的ESLint外掛來幫助執行其編程規則。[22][23]

截至2021年,ESLint是最常用的JavaScript linter,每周被下載超過14,000,000次。[24]

參考資料

  1. ^ Release 8.57.0. 2024年2月23日 [2024年3月22日]. 
  2. ^ First commit - eslint/eslint. GitHub. [2019-07-05]. (原始内容存档于2021-06-29) (英语). 
  3. ^ 3.0 3.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 
  4. ^ The future of TypeScript on ESLint. ESLint - Pluggable JavaScript linter. [2020-04-24]. (原始内容存档于2021-04-13) (英语). 
  5. ^ Accessibility auditing with eslint-plugin-jsx-a11y. web.dev. Google Developers. 2019-04-29 [2020-04-24]. (原始内容存档于2021-02-01) (英语). The [ELint plugin] can help pinpoint [issues] in your JSX. 
  6. ^ Understanding the Real Advantages of Using ESLint. Rangle.io Blog. 2015-03-26 [2018-02-26]. (原始内容存档于2019-02-09). 
  7. ^ Rename project to ESLint · eslint/eslint@4f4c351. GitHub. 4 July 2013 [2020-06-26]. (原始内容存档于2021-12-23) (英语). 
  8. ^ Zakas, Nicholas. ESLint Joins The jQuery Foundation. eslint.org. 19 April 2016 [2019-07-05]. (原始内容存档于2021-01-27) (英语). 
  9. ^ jQuery Foundation and Dojo Foundation to Merge. Official jQuery Blog. 1 September 2015 [2018-07-02]. (原始内容存档于2021-02-09) (美国英语). 
  10. ^ jQuery Foundation and Dojo Foundation to Merge. PRWeb. 1 July 2015 [2018-07-02]. (原始内容存档于2020-11-08). 
  11. ^ Announcing the JS Foundation!. SitePen. 2016-10-17 [2018-07-02]. (原始内容存档于2020-09-25) (美国英语). 
  12. ^ ESLint Graduates from JS Foundation Mentorship Program. JS Foundation Blog. 2017-10-05 [2019-07-05]. (原始内容存档于2019-07-05) (美国英语). 
  13. ^ Singh, Manish. Node.js and JS foundations are merging to form OpenJS. VentureBeat. 2019-03-12 [2019-03-21]. (原始内容存档于2021-02-11). 
  14. ^ The Node.js Foundation and JS Foundation Announce an Intent to Merge. JS Foundation Blog. 2018-10-04 [2019-07-05]. (原始内容存档于2019-07-05) (美国英语). How will this impact the technical direction of … ESLint This will not change the technical independence for projects like ESLint. 
  15. ^ WebStorm Linting, refactoring and compiling. WebStorm Blog. JetBrains. 30 December 2015 [2019-07-05]. (原始内容存档于2021-02-25) (美国英语). 
  16. ^ Using JavaScript Standard Style. WebStorm Blog. JetBrains. 7 April 2017 [2019-07-05]. (原始内容存档于2021-01-28) (美国英语). 
  17. ^ ESLint - WebStorm Manual. JetBrains. [2019-07-05]. (原始内容存档于2020-11-11). 
  18. ^ Writing Vue.js Applications in TypeScript. Telstra Kloud. [2019-07-05]. (原始内容存档于2020-04-01). 
  19. ^ Lesson: Automatic Linting with ESLint - The Vue.js Master Class. Vue School. [2019-07-05]. (原始内容存档于2021-02-04) (英语). 
  20. ^ Introduction | eslint-plugin-vue. eslint.vuejs.org. [2019-07-05]. (原始内容存档于2021-02-25). 
  21. ^ The Vue Handbook: a thorough introduction to Vue.js. Developer News. 2018-07-05 [2019-07-05]. (原始内容存档于2021-01-21) (英语). Use the interactive CLI to create a new Vue project [..] By default, there is [..] ESLint integration 
  22. ^ ESLint Plugin – Rules of Hooks – React Manual. reactjs.org. [2019-07-05]. (原始内容存档于2021-06-06) (英语). 
  23. ^ Markbåge, Sebastian. Implement the Hooks proposal · facebook/react. GitHub. 25 October 2018 [2019-07-05]. (原始内容存档于2020-11-12) (英语). 
  24. ^ jslint vs jshint vs eslint vs tslint vs @typescript eslint/eslint plugin. www.npmtrends.com. [2021-01-26]. (原始内容存档于2021-02-02) (英语). 

外部鏈結