Picture of Michael Lee
:wave: Hey hey, I'm Michael Lee and this is my site about being a developer, being a dad and making side projects.

Stop Ember.js from complaining about "Missing semicolon"

Written on April 29, 2016

If you build Ember.js applications, chances are you’ve run into JSHint complain about Missing semicolon. Recently for work our team adopted the JavaScript Standard Style, that does away with semicolons. When we first implemented this style in our Ember applications, JSHint was complaining a ton.

Looking through JSHint’s docs on options, it turns out you can get JSHint to stop complaining about missing semicolons. Within your Ember app, there’s a file called .jshintrc, which is found at the root level of your Ember project folder. This file is used by JSHint to determine what rules to follow. All you have to do is add another key-value pair of "asi": true to the object and JSHint will stop complaining about missing semicolons from now on.

Your .jshintrc file should look something like this:

// .jshintrc
{
  "predef": [
    "document",
    "window",
    "-Promise",
    "moment"
  ],
  "browser": true,
  "boss": true,
  "curly": true,
  "debug": false,
  "devel": true,
  "eqeqeq": true,
  "evil": true,
  "forin": false,
  "immed": false,
  "laxbreak": false,
  "newcap": true,
  "noarg": true,
  "noempty": false,
  "nonew": false,
  "nomen": false,
  "onevar": false,
  "plusplus": false,
  "regexp": false,
  "undef": true,
  "sub": true,
  "strict": false,
  "white": false,
  "eqnull": true,
  "esnext": true,
  "unused": true,
  "asi": true
}
Thanks for taking the time to read this article. I'd love to stay in touch and share more tips on programming and design and side projects. Sign up and I'll send you my articles straight to your email.