I usually fix the scripts so that shellcheck is completely happy. The occasional times that there's a warning that you know is not relevant, you can add a comment just above the offending line e.g.
# shellcheck disable=SC2154
(That's for not warning about using a variable that hasn't been defined)