Add "inline-comment-spacing" lint rule#17893
Conversation
|
Personally, I find it far more readable with the spaces providing some separation. Is there a general community default/agreement on this (i.e. linter defaults)? Or just personal preference? |
8b2a429 to
3d377b7
Compare
|
We get 5000 lines of errors if I invert the test condition and require spaces, so we've been preferring |
| }); | ||
| } | ||
|
|
||
|
|
| "indent": [true, | ||
| "spaces" | ||
| ], | ||
| "inline-comment-spacing": true, |
There was a problem hiding this comment.
Maybe we should have a separate rule for "inline-callExpressionArgument-comment-spacing"? Or maybe name it analogously to "boolean-trivia"? eg: "boolean-trivia-spacing"?
There was a problem hiding this comment.
How about renaming boolean-trivia to literal-argument-comment and inline-comment-spacing to argument-comment-spacing?
There was a problem hiding this comment.
Are scripts/tslint rules accessible outside our repo? Are rules in this directory a sort of test-bed for adding rules to tslint itself?
If these are only used by us, then that works for me. We probably shouldn't rename these if someone else is using the boolean-trivia rule.
There was a problem hiding this comment.
These are our own internal rules. Some of them might be suitable to submit to tslint itself, if you want to, although there may be overlap, e.g., no-type-assertion-whitespace may already be handled by tslint's whitespace rule.
|
Do we need this new rule? seems like a lot of work, and limited value in my opinion. |
|
Do not think we need this one. closing for now, please reopen if you feel otherwise. |
This would check that we write
f(/*argName*/ true)and notf(/* argName */ true).I'd also like to lint for spacing on statement comments like:
But we don't have a consistent style here -- thoughts?