If you want portable shell-scripts that come with their dependencies bundled, Nix also has a solution: writeShellApplication[0] (and more simpler ones like writeShellScript).
writeShellApplication will call shellcheck[1] on your script and fail to build if there are any issues reported, which I think is the only sane default.
[0]: https://nixos.org/manual/nixpkgs/stable/#trivial-builder-wri...
[1]: https://www.shellcheck.net/