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.22M
  • Win 1.17M
  • Mac 637K
  • Linux 412K
Dec 1 Nov 30 Nov 29 Nov 28 Nov 27 Nov 26 Nov 25 Nov 24 Nov 23 Nov 22 Nov 21 Nov 20 Nov 19 Nov 18 Nov 17 Nov 16 Nov 15 Nov 14 Nov 13 Nov 12 Nov 11 Nov 10 Nov 9 Nov 8 Nov 7 Nov 6 Nov 5 Nov 4 Nov 3 Nov 2 Nov 1 Oct 31 Oct 30 Oct 29 Oct 28 Oct 27 Oct 26 Oct 25 Oct 24 Oct 23 Oct 22 Oct 21 Oct 20 Oct 19 Oct 18 Oct 17
Windows 60 130 94 115 81 88 104 122 113 108 104 88 83 114 149 136 133 120 103 90 106 126 139 132 120 102 88 62 124 112 123 108 80 82 96 113 113 102 122 82 74 120 131 146 133 143
Mac 23 39 66 54 35 34 43 49 66 58 46 46 31 59 49 56 59 50 26 34 53 78 57 54 47 37 30 27 61 58 53 44 26 24 46 64 61 61 30 28 21 68 52 80 57 45
Linux 18 33 36 46 27 28 37 42 45 45 38 32 35 37 63 44 30 65 27 32 40 47 46 39 47 35 27 18 54 42 46 33 26 20 47 45 44 44 49 41 29 40 42 42 41 46

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 🙄