Typescript TSLint如何允许注释格式规则的URL?
我使用的是TypeScript和React以及带有注释格式规则的TSLintTypescript TSLint如何允许注释格式规则的URL?,typescript,tslint,Typescript,Tslint,我使用的是TypeScript和React以及带有注释格式规则的TSLint 现在我得到一个奇怪的警告,注释格式规则不允许JSX中的URL 此处的示例代码: <a href="https://www.google.co.jp">https://www.google.co.jp</a> tslint.json此处: { "extends": ["tslint:latest", "tslint-react"], "rules": {} } 套餐: “类型脚
<a href="https://www.google.co.jp">https://www.google.co.jp</a>
tslint.json此处:
{
"extends": ["tslint:latest", "tslint-react"],
"rules": {}
}
套餐:
- “类型脚本”:“^1.8.10”
- “tslint”:“^3.15.1”
- “tslint react”:“^1.0.0”
有人知道这方面的解决方法吗?我通过使用flag找到了一个解决方法。 但我不确定这是否是最好的方法
{/* tslint:disable: comment-format */}
<a href="https://www.google.co.jp">https://www.google.co.jp</a>
{/* tslint:enable: comment-format */}
{/*tslint:disable:comment格式*/}
{/*tslint:enable:comment格式*/}
听起来问题在于它认为您的url是一条注释(因为是双斜杠)。您应该尝试找到允许JSXYE的规则,这是真的。所以我试着问是否有人有更好的主意。
{/* tslint:disable: comment-format */}
<a href="https://www.google.co.jp">https://www.google.co.jp</a>
{/* tslint:enable: comment-format */}