javascript - 打字稿。TSLint 在类型中不起作用
问题描述
所以我无法理解如何在tslint.json
. 因为现在它不会检查并且不会Types
在 TypeScript 中产生任何错误。同样在Interfaces
其中正常工作并在我使用不同的东西时抛出错误 那我;
怎么能做到呢Types
?...
export type IProps = {
active?: boolean, // no error
title?: string; // no error
text?: string // no error
}
tslint.json:
{
"defaultSeverity": "error",
"extends": [
"tslint-config-airbnb",
"tslint-eslint-rules",
"tslint-react"
],
"jsRules": {},
"rulesDirectory": [],
"rules": {
"arrow-parens": false,
"whitespace": [
false,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type"
],
}
}
解决方案
你正在寻找type-literal-delimiter
规则。只需false
在true
您的tslint.json
.
推荐阅读
- calendar - 有没有办法将事件“注入”到现有的 .ICS 日历提要中?
- android - 如何使用 clicklistener 在 Canvas 上绘制多个 Imageview
- django - 流式 http 响应不显示完整内容
- python - Python:将 csv 转换为 dict - 使用标题作为键
- operating-system - 操作系统管理任务 - 处理器管理
- reactjs - 使用带有 AvField 的 Reactstrap 和/或availity-reactstrap-validation 是否可以在输入有效项目时显示绿色的“有效”框?
- firebase - 如何将 Firestore 文档列表打印到控制台?
- c# - 根据用户登录活动创建日志记录 C#
- jboss - 如何在 Wildfly 16 中杀死线程或进程?
- javascript - roll20 的铜到银、金的转换