- Ensure
shellcheck
is installed (v0.4.7
or better is recommended to use). - Run
Install Extension
command from Command Palette. - Search and choose
shellcheck
.
There are various options that can be configured by making changes to your user or workspace preferences.
Default options are:
{
"shellcheck.enable": true,
"shellcheck.run": "onType",
"shellcheck.executablePath": "shellcheck",
"shellcheck.exclude": [],
"shellcheck.customArgs": [],
"shellcheck.ignorePatterns": {},
"shellcheck.useWSL": false
}
By default the linter will lint as you type. Alternatively, set shellcheck.run
to onSave
if you want to lint only when the file is saved (works best if auto-save is on).
{
"shellcheck.run": "onType" // also: "onSave"
}
By default all shellcheck checks are performed and reported on as necessary. To globally ignore certain checks in all files, add the "SC identifiers" to shellcheck.exclude
. For example, to exclude SC1017:
{
"shellcheck.exclude": [1017],
}
In order to get it work, you need a "shim" script, and then, just remember, do not try to construct command line arguments for shellcheck yourself.
Here is a simple "shim" script to get start with (See discussion: #24):
#!/bin/bash
exec docker run --rm -i -v "$PWD:/mnt:ro" koalaman/shellcheck:v0.5.0 "$@"
This extension is based on hoovercj's Haskell Linter.