Skip to content

Instantly share code, notes, and snippets.

@sgnl
Created March 15, 2017 20:13
Show Gist options
  • Save sgnl/7f00f56db83749c47388e0c1ac62aa17 to your computer and use it in GitHub Desktop.
Save sgnl/7f00f56db83749c47388e0c1ac62aa17 to your computer and use it in GitHub Desktop.
Dev League Javascript Linter Installation with XO and Sublime Linter
  1. Install/Verify you have Sublime Text 3 (http://sublimetext.com/3)

  2. Install/Verify that Package Control Module is installed to for Sublime Text: https://packagecontrol.io/installation

Linux: Click the Preferences > Browse Packages… menu Browse up a folder and then into the Installed Packages/ folder Download Package Control.sublime-package and copy it into the Installed Packages/ directory Restart Sublime Text

  • Open up Package Control in your sublime text. (cmd+shift+P)

    1. Type PC Install to make use of FuzzySearch to bring up Package Control: Install Package
    2. Hit the enter key
    3. Wait the repositories to load (look at the status bar at the bottom) give it a few seconds.
    4. Type SublimeLinter and hit enter to install it
  • Repeat the step above but this time look for the package named Sublimelinter-xo

  • Documentation file will appear in your sublime text, keep this file open and refer to it if you have any problems!

  • In Terminal install the jshint npm module globally.

    • e.g. npm install --global xo (if you get an EACCESS error, DO NOT USE sudo call over an instructor)
  • right-click on the document

    • Navigate to 'Sublimelinter > Lint Mode > enable the Background setting
    • Navigate to 'Sublimelinter > Mark Style > enable the Outline setting
    • Navigate to 'Sublimelinter > Choose Gutter Theme..." and select Blueberry - Round from the list
  • Quit Sublime Test (cmd+Q or alt+f4)

  • Open sublime text

  • Create a new file in Sublime Text with cmd+n

  • Change the Syntax to recognize Javascript, cmd+shift+p

  • type ss javas (fuzzy search for 'Set Syntax: Javascript) then hit enter

  • add 'use strict'; to the top of the file

  • add this broken code to the file

    • e.g. function ({var;;};
  • Lint! Yay

  • No Lint? Follow the Documentation that opened up when you first installed SublimeLinter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment