tslint-consistent-codestyle icon indicating copy to clipboard operation
tslint-consistent-codestyle copied to clipboard

Add rule to detect useless blocks

Open ajafff opened this issue 6 years ago • 0 comments
trafficstars

Useless blocks

  • don't have a label
  • are contained in other block-like Nodes
    • excludes block as children of IterationStatement, IfStatement, WithStatement, TryStatement, ArrowFunction
    • maybe exclude blocks in CatchOrDefaultClause (if it's the only statement in there)
  • don't contain block scoped declarations

That idea came up in #103

ajafff avatar Jan 04 '19 23:01 ajafff