正在关注 these准则(和几乎所有其他准则)、function
和 var
名称应使用 lowerCamelCase,而 Class
(和 c'tors)名称应使用 UpperCamelCase。
我一直在寻找一个 ESLint
规则来执行这个约定,但我找到的最接近的是 id-match它似乎没有区分 function
、var
或 class
。
有更好的规则吗?我应该将 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/