I was studying the shift operator in quantum mechanics from wikipedia and in the commutator section explains that for a shift operator $\hat T(x)$ and a position operator $\hat x$, the commutator $\left [\hat T(x),\hat x\right]=x\hat T(x)$, but doesn't make sense to me, because it seems like you are shifting "eternally" by the function $x$. In the wikipedias's position operator, it indicates that the eigenfunction of $\hat x$ is the Dirac delta function $\delta_a(x)$ centered at $a$, so I did the algebra as follows:
For a shift of $h$-units $\hat T_h$ (using calculus notation):
$$\left[x,T_h \right]\delta_a(x)=x(T_h(\delta_a(x))-T_h(x\delta_a(x)) $$
$$=x(\delta_a(x+h))-T_h(a\delta_a(x))=(a-h)\delta_a(x+h)-a\delta_a(x+h)$$
$$=a\delta_{a+h}(x)-h\delta_{a+h}(x)-a\delta_{a+h}(x)=-h\delta_{a+h}(x)=-hT_h(\delta_a(x))$$
$$\Rightarrow \left[x,T_h \right]=-hT_h$$
So, if we subsitute $h$ for $x$, the result would be the same as explained in the source, but one is a scalar multiplication, and the other is point-wise multiplication of two functions. If we do the substitution, by this other source about shift operator, the conmmutator applied to Dirac delta should be:
$$\left[x,T_x \right]\delta_a(x)=x\delta_a(ex)-T_x(a\delta_a(x))$$ $$=x\delta_a(ex)-a\delta_a(ex)={a\over e}\delta_a(ex)-a\delta_a(ex)$$ $$=a\left({1-e\over e}\right)\delta_a(ex)=a\left({1-e\over e}\right)T_x(\delta_a(x))$$ $$\Rightarrow \left[x,T_x \right]=a\left({1-e\over e}\right)T_x$$
Your confusion comes from the fact that you are merging two different operators together.
The first derivation you made is correct, i.e. $[x,T_h] = hT_h$ (by the way, you needn't consider the Dirac delta eigenfunctions, the relation is valid for any function of $x$). However, it is to be kept in mind that $T_h = e^{h\partial_x}$ can be interpreted as a translation/shift operator only when $h$ is a fixed/constant quantity.
The second relation is almost correct; it should be $[x,T_x] = (e-1)xT_x$ (which can be also applied not only to Dirac delta functions but to any function of $x$), since $T_x = e^{x\partial_x}$ is a scaling operator $-$ the general case is given by $e^{tx\partial_x}f(x) = f(e^tx)$.
In conclusion, we are talking about two different operators, such that the constant shifting parameter $h$ in $T_h$ cannot be merely replaced by the (non-constant) variable $x$ without changing its nature.