Linting is a term for flagging suspicious and non-portable constructs, likely to be bugs in any written language. SublimeLinter is a plugin that supports linting and has the following linters built in:
cppcheck
via coffee –s –l
csslint
haml –c
tidy
javac –Xlint
jshint
, jslint
, or gjslint
(if installed)luac
capp_lint
Perl::Critic
or syntax and deprecation check via perl-c
php –l
puppet parser validate
ruby –wc
xmllint
We can install this plugin by using the Package Control that we installed earlier. Let's open it by pressing Ctrl + Shift + P in Windows or Linux and command + Shift + P in OS X; choose Install Package and install the SublimeLinter plugin.
SublimeLinter can run in four different modes; the current mode is set by the sublimelinter
key in the user settings:
sublimelinter
key is set to true
, linting is performed constantly in the background while we modify the file.sublimelinter
key is set to load-save
, linting will be performed when a file is loaded and after the file is saved.sublimelinter
key is set to save-only
, linting is performed only after a file is saved.sublimelinter
key is set to false
, linting will only be initiated by us. We can initiate a lint by pressing Ctrl + Alt + L on Windows or Linux and Control + command + L on OS X.
We can also control all SublimeLinter settings and initiate an instant lint fromthe
command
palette. Press
Ctrl + Shift + P or command + Shift + P and type SublimeLinter:
; you will see all the options for quick linting and quick mode changing.
There are a number of customizations that SublimeLinter supports:
We won't cover these customizations in this book, but we can always go to https://github.com/SublimeLinter/SublimeLinter, and learn more about them.