Angular TSLint:仅允许使用驼峰式大小写,不允许使用Pascal大小写

时间:2020-09-03 16:18:35

标签: angular typescript tslint angular10

我们正在用Angular编写代码,只想允许小写的首字母Camel大小写。例如,ProductName应该显示显示警告/错误(因为大写)。

如何在TSLint中仅允许使用camelCase,而不允许Pascal(大写)?

this.product.ProductName = 5;

以下内容仅在Class组件本身中未显示使用错误

export class Product {
  ProductId: number;
  ProductName: string;
}

TS棉绒设置:

"variable-name": {
  "options": [
   "ban-keywords",
   "check-format"
 ]

}

https://palantir.github.io/tslint/rules/variable-name/

0 个答案:

没有答案
相关问题