-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Add "inline-comment-spacing" lint rule #17893
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 |
}); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: extra trailing lines?
tslint.json
Outdated
@@ -11,6 +11,7 @@ | |||
"indent": [true, | |||
"spaces" | |||
], | |||
"inline-comment-spacing": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about renaming boolean-trivia
to literal-argument-comment
and inline-comment-spacing
to argument-comment-spacing
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?