javascript - 带有 TypeScript 的函数名称的 ESlint 规则(驼峰式,首字母小写)

标签 javascript node.js typescript eslint

正在关注 these准则(和几乎所有其他准则)、functionvar 名称应使用 lowerCamelCase,而 Class(和 c'tors)名称应使用 UpperCamelCase。

我一直在寻找一个 ESLint 规则来执行这个约定,但我找到的最接近的是 id-match它似乎没有区分 functionvarclass

有更好的规则吗?我应该将 id-match 规则与 new-cap 一起使用吗?规则? (感觉很脏)

最佳答案

不幸的是,目前似乎没有更好的选择......

Unfortunately, it looks like there wasn't enough interest from the team or community to implement this change. While we wish we'd be able to accommodate everyone's requests, we do need to prioritize. We've found that issues failing to reach accepted status after 21 days tend to never be accepted, and as such, we close those issues. This doesn't mean the idea isn't interesting or useful, just that it's not something the team can commit to. https://github.com/eslint/eslint/issues/10473

关于javascript - 带有 TypeScript 的函数名称的 ESlint 规则(驼峰式,首字母小写),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57031100/

相关文章:

javascript - 如何在屏幕中间显示div

javascript - 删除txt文件(NODE.js)中的一行

node.js - 如何知道投影已完成并需要在 CQRS 中发布实时订阅事件?

node.js - 删除 node_modules\.cache\terser-webpack-plugin 下的过长文件名时出现问题

visual-studio - 带有 TypeScript 和 node_modules 的 Visual Studio Resharper

typescript - 如何导入其他 TypeScript 文件?

javascript - 什么类型应该返回服务器端组件

javascript - jquery确定2个div之间的重叠量

css - Angular Material Slide Toggle不改变绑定(bind)变量

javascript - 在 JavaScript 中声明一个没有名字的函数