$on the left side of assignments.
Alternatively, if the goal was to assign to a variable whose name is in another variable (indirection), use
name=foo declare "$name=hello world" echo "$foo"
Or if you actually wanted to compare the value, use a test expression:
if [ "$greeting" = "hello world" ] then echo "Programmer, I presume?" fi
Unlike Perl or PHP,
$ is not used when assigning to a variable.
ShellCheck is a static analysis tool for shell scripts. This page is part of its documentation.