Mine is that the useState hook is an actual plague on the entire React ecosystem. Regardless of your opinions of React, if you wanna use something then use it right.

  • jjj@piefed.blahaj.zone
    link
    fedilink
    English
    arrow-up
    11
    ·
    1 day ago

    …which is why I love #[rustfmt::skip] so much! You can do stuff like

    #[rustfmt::skip]
    const DIRECTIONS: [[i8; 2]; 4] = [
                 [0, 1],
        [-1, 0],          [1, 0],
                 [0, -1],
    ]
    

    while still enjoying the convenience of auto formatting elsewhere.

    Although linters which act on the behavior of code are unequivocally a good thing, e.g. “hey, this comparison will always return false you probably made a mistake here”.

    • calcopiritus@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      1 day ago

      Any formatter annotation just clutters the code though. Except maybe if it is file-wide.

      I prefer that my editor formats it in a sensible way as I code. If there’s something I wanna do with a different formatting, I just do so. But the rest is formatted as I write it, instead of afterwards.