Hacker News new | ask | show | jobs
by OkayPhysicist 58 days ago
> 95% of this is covered by a warning that says "I won't merge any PR that a) does not pass linting (configured to my liking) and b) introduces extra deps"

Maybe I'm not up to date with the bleeding edge of linters, but I've never seen one that adequately flags

    let out = []
    for(let x of arr){
      if(x > 3){
        out.append(x + 5)
      }
    }
Into

   let out = arr
             .filter(x => x > 3)
             .map(x => x + 3)
There's all sorts of architectural decisions at even higher levels than that.
1 comments

Indeed, yours has both more allocations and a bug (+3 instead of +5)
More allocations is a good point but you're being pedantic about the bug... how do you know the +5 isn't the bug? :P