2

In Vue js semicolon is optional?

Comments
  • 7
    In JavaScript it is. But last time I checked (5 years ago) the code with semicolon is quicker.
  • 2
    @Codex404 nowadays it's the other way around, sadly.
  • 2
    Yes it's optional for 99.9% of the time
  • 9
    It is optional, but I will always leave an angry comment and deny your PR if you don't use it.
  • 2
    @Codex404 by only a couple of cycles. And even then, when ```npm run build``` is run you get it all minified which is one of those like two cases where you have to have semicolons

    in fact here's a fun little chart

    https://jsperf.com/asi-performance/...
  • 1
    it optional but prettier forces to remove by default, tbh i never questioned why :D
  • 1
    Use strict;
  • 1
    @dUcKtYpEd And I will force an eslint pre-commit hook onto you to stop you from fucking up the minifier because you are unable to press one key per line more that literally requires no thinking.
  • 2
    I don't put semicolons. Discussions like this are for pitiful developers who focus more on whining than to actually do proper work for people. Just do your job, and make code easy to change. that's it.

    I like how some here feel superior by denying PRs just to bitch about semicolons. Seems like it's the only thing in life they control.
  • 0
    Here's a fun chat about it between Douglas Crockford (js core dev) and Jacob Thornton (bootstrap author) having a fun chat about it.
    Douglas is against no semis, while Jacob is in favor.
  • 0
    @bartmr or we write consistent code and all the code is using semicolons.
  • 1
    @dUcKtYpEd Enforcing consistent code and linting is something entirely different.
  • 1
    @dUcKtYpEd there is a difference between being an fucking ass and writing clean consistent code. If you don't want to adhere to the rules made you are an ass. Im 100% @PrivateGER will not be an ass about missing semicolons in PRs of a project which is currently not using semicolons.
    He might make a discussion with the team as to why he thinks semicolons are preferred.

    Personally (like many other JavaScript devs) have never worked without semicolons in my ten years of me writing JavaScript in collaboration with others.

    My boss sometimes forgets to adhere to his own conventions am I then being an ass to correct him on it or is he by just failing to follow the conventions he had written up?
  • 0
    @Codex404 > My boss sometimes forgets to adhere to his own conventions am I then being an ass to correct him on it or is he by just failing to follow the conventions he had written up?

    I do that as well if I'm working without eslint and autofixing
  • 0
    @inaba there is ESlint. And I understand it happens sometimes but I will tell you to fix it.
  • 0
    @Codex404 i don't really see a reason as to why you would waste your time doing eslints' job. But if that's what gets you off then 🤷 good for you I guess
  • 0
    @inaba he configured ESlint but he just ignores the errors (or doesn't see them) I don't tell him on a daily basis. Maybe once a month.
  • 0
    It is good information
Add Comment