My .jshintrc

See https://github.com/coolaj86/oh-my-dotfiles/blob/master/dummy/.jshintrc for the most up-to-date version.

{ "node": true
, "browser": true
, "jquery": true
, "strict": true

, "indent": 2
, "onevar": true
, "laxcomma": true
, "laxbreak": true

, "eqeqeq": true
, "immed": true
, "undef": true
, "unused": true
, "latedef": true

, "curly": true
, "trailing": true
}

Why?

Some things are a matter of preference, but some things are empirically better.

I've separated my file into 3 parts

  • Environment
  • Style
  • Quality

You can see the definitions for each of the options I use at http://jshint.com/docs/#options.

Environment

I assume all of the common environments since all modern browsers (and even MSIE) support ES5 and strict mode.

Style

You should definitely have a style that you live by, but it doesn't have to be mine.

The style I choose isn't meant to give the developer visually artistic expression.

It's meant to give the developer code that is closer to what the compiler actually runs without going overboard.

Quality

Regardless of your style, if your code isn't qualatious, it sucks. If you use globals all over the place, I hate you.

The problem solved by the quality options is that of reducing the number of mistakes you make either on accident, by ignorance or, in some cases, just because you're too obsessed with coding with your pants off.

Clean Slate

To get vim back to a freshly installed state, first close it and then run the following:

mv ~/.vimrc ~/vimrc.bak
mv ~/.vim ~/vim.bak
# rm -rf ~/vimrc.bak ~/vim.bak

To get Sublime back to a freshly installed state, first close it and then run the following:

mv -rf ~/Library/Application\ Support/Sublime\ Text\ 2/ ~/Library/Application\ Support/Sublime\ Text\ 2.bak
# rm -rf ~/Library/Application\ Support/Sublime\ Text\ 2.bak

By AJ ONeal

If you loved this and want more like it, sign up!


Did I make your day?
Buy me a coffeeBuy me a coffee  

(you can learn about the bigger picture I'm working towards on my patreon page )