Background or reasoning for error: TsLint: comment must start with lowercase letter
Asked Answered
S

2

11

I'm getting the following TsLint message in my project:

TsLint: comment must start with lowercase letter

Is there any grounding behind this? I agree with most of what I've come across in TsLint, and I'm aware of the ability to turn this warning off.

I'd rather understand why they suggest this particular rule. I read the docs at https://github.com/palantir/tslint#supported-rules which explain what the rule does but not why.

Sunstroke answered 15/12, 2014 at 6:22 Comment(2)
I don't use Typescript, but I suspect there's a coding convention that makes special use of comments that start with capitals.Bryannabryansk
According to check-in history at github.com/palantir/tslint/commit/… this rule was introduced by github.com/gscshoyru on Dec 2, 2013. Asking this question at the source might be the best way to get your answerStyles
R
15

I asked the author on this one.

This is just a style rule, and can safely be ignored if it's not needed

Personally speaking, I can think of no reason to enforce this rule so I recommend disabling it or ignoring it.

Ritter answered 17/12, 2014 at 19:55 Comment(2)
Wow, that is the dumbest style rule I can remember seeing. What kind of sense does it make to say "comments must not be complete English sentences?" I think that "it's just a style rule" is not a good enough answer to "why did you think this was a good idea?"Clouet
As additional detail for people who want to leverage their IDE's "TODO" highlighting / processing, you can add words that it will ignore in the rules: palantir.github.io/tslint/rules/comment-formatCounter
N
0

add this rule to your tslint.json:

"comment-format": [false, "check-uppercase"]
Nicol answered 14/3, 2019 at 14:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.