0
votes

I am using TypeScript and React and TSLint with comment-format rule.

now I got a weird warning that the comment-format rule doesn't allow URL in the JSX.

sample code here:

<a href="https://www.google.co.jp">https://www.google.co.jp</a>

warning here:

comment must start with a space

tslint.json here:

{
  "extends": ["tslint:latest", "tslint-react"],
  "rules": {}
}

packages:

  • "typescript": "^1.8.10"
  • "tslint": "^3.15.1"
  • "tslint-react": "^1.0.0"

Anyone know any workaround for that?

1
Sounds like the problem is that it thinks that your url is a comment (cos of the double slash). You should try and find rules that allow for JSXAron
yes, that is true. so I tried to ask if anyone has a nicer idea.mitsuruog

1 Answers

0
votes

I found a workaround by using flag. but I am not sure if it is the best way, though.

{/* tslint:disable: comment-format */}
<a href="https://www.google.co.jp">https://www.google.co.jp</a>
{/* tslint:enable: comment-format */}