You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would be great if this filter didn't trigger when comments are within the statement, often time's I see or have commented out code in conditionals for debugging or marking areas I need to implement something later. In a large project where these TODOs exist, it can plug up the lint log with lots of non-issues.
The text was updated successfully, but these errors were encountered:
There are several problems I have with this, one technical and one conceptually:
Technically, comments are only stored with a position. To figure out whether a comment "belongs to" an if statement, I'd have to look through all the comments and check whether the position is between the if and end of the if-statement I'm about to give a warning about for being empty.
Secondly, empty if-statements are dead code containing a potentially expensive condition expression. Regardless of whether they contain a comment or not, they are redundant. If you never fill in the -- TODO, you keep the empty if-statement, which is well worth a warning. It would be better to comment out the entire if-statement.
Because of that I don't think any time should be spent on implementing this. An if statement is empty too when contains only comments.
Would be great if this filter didn't trigger when comments are within the statement, often time's I see or have commented out code in conditionals for debugging or marking areas I need to implement something later. In a large project where these TODOs exist, it can plug up the lint log with lots of non-issues.
The text was updated successfully, but these errors were encountered: