ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Sublime​Linter

by SublimeLinter ALL Top 25

The code linting framework for Sublime Text

Details

Installs

  • Total 2.24M
  • Win 1.18M
  • Mac 641K
  • Linux 415K
Mar 26 Mar 25 Mar 24 Mar 23 Mar 22 Mar 21 Mar 20 Mar 19 Mar 18 Mar 17 Mar 16 Mar 15 Mar 14 Mar 13 Mar 12 Mar 11 Mar 10 Mar 9 Mar 8 Mar 7 Mar 6 Mar 5 Mar 4 Mar 3 Mar 2 Mar 1 Feb 28 Feb 27 Feb 26 Feb 25 Feb 24 Feb 23 Feb 22 Feb 21 Feb 20 Feb 19 Feb 18 Feb 17 Feb 16 Feb 15 Feb 14 Feb 13 Feb 12 Feb 11 Feb 10 Feb 9
Windows 8 91 124 138 131 118 136 76 92 132 101 132 131 142 105 83 129 147 147 179 94 90 93 108 137 132 138 112 80 99 121 141 135 132 122 70 96 130 138 123 119 110 64 83 123 125
Mac 3 39 39 46 58 56 57 27 34 39 59 54 57 59 44 39 55 63 51 54 49 39 30 45 43 70 57 67 32 34 56 52 57 36 43 27 46 76 62 61 60 51 34 34 71 48
Linux 3 26 51 44 47 31 36 43 28 40 43 42 42 35 37 28 42 46 40 46 38 28 23 44 27 41 47 35 32 27 43 42 46 35 43 33 34 34 37 49 44 32 30 40 50 42

Readme

Source
raw.​githubusercontent.​com

SublimeLinter

tests

The code linting framework for Sublime Text. No linters included: get them via Package Control.

Installation

Install SublimeLinter and linters via Package Control.

Settings

Settings are documented in the default settings. Open the settings using the Command Palette (ctrl+shift+P) searching for Preferences: SublimeLinter Settings (mnemonic: sls).

When you open the SublimeLinter settings you'll see the defaults on the left or top. Usually that's all that is needed for end-users but some additional information is in our docs at sublimelinter.com.

Quick Actions/Fixers

As we do just linting SublimeLinter naturally does not come with fixers and/or code formatters. However, we have a fixer API and ship (mostly) “fix by ignoring” actions. These allow you to quickly ignore specific error messages inline and ad hoc.[1]

SublimeLinter currently ships actions for eslint, stylelint, flake8, mypy, shellcheck, codespell and phpcs.

Want to see actions for your favourite linter? Please open a PR with your addition to quick_fix.py. We have tests for them!

[1] Why this limitation though? Well it is usually easy to add a semicolon here and a space there, but the inline ignore rules and syntaxes are very cumbersome to type and to remember. And there is basically no project of any size where you don't have to ignore ad-hoc something somewhere once.

Key Bindings

SublimeLinter comes with some pre-defined keyboard shortcuts. You can customize these via the Package Settings menu.

Command Linux & Windows MacOS
Lint this view CTRL + K, L CTRL + CMD + L
Open diagnostics panel CTRL + K, A CTRL + CMD + A
Goto next error CTRL + K, N CTRL + CMD + E
Goto prev error CTRL + K, P CTRL + CMD + SHIFT + E

Take also a look at the default bindings.sublime-keymap>) because we document other commands and have usually some tricks in there too.

For example, it is very advisable to bind sublime_linter_quick_actions, e.g.

// To trigger a quick action
    // { "keys": ["ctrl+k", "ctrl+f"],
    //   "command": "sublime_linter_quick_actions"
    // },

Support & Bugs

Yeah, totally! Often if it doesn't work, Sublime will have something in the console (View -> Show Console). Enable debug mode in the settings, restart Sublime Text and look at the console output for anything.

If your issue is specific to a particular linter, please report it on that linter's repository, otherwise open it right here.

Creating a linter plugin

Fork the template to get started on your plugin. It contains a howto with all the information you need. Of course, take a look at a similar linter plugin and let it inspire you.

Also Support

❤️😒 Donate 🙄