ESLint

本页使用了标题或全文手工转换
维基百科,自由的百科全书
ESLint
原作者Nicholas C. Zakas
开发者Nicholas C. Zakas
首次发布2013年6月30日,​10年前​(2013-06-30
当前版本
  • 9.1.0 (2024年4月19日;稳定版本)[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 9.1.0. 2024年4月19日 [2024年4月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) (英语). 

外部链接