METHOD 1:
The Complex Fourier Series on the interval $[-\pi,\pi]$ for a function $f$ is written
$$f(x)=\sum_{n=-\infty}^{\infty}c_ne^{inx} \tag 1$$
where the coefficients $c_n$ are given by
$$c_n=\frac{1}{2\pi}\int_{-\pi}^{\pi}f(x)e^{-inx}\,dx \tag 2$$
Substituting $2$ into $(1)$ reveals that
$$f(x)=\sum_{n=-\infty}^{\infty}\left(\frac{1}{2\pi}\int_{-\pi}^{\pi}f(x')e^{-inx'}\,dx'\right)\,e^{inx}$$
whereupon formal interchange of the series and integral yields
$$f(x)=\int_{-\pi}^{\pi}f(x')\left(\frac{1}{2\pi}\,\sum_{n=-\infty}^{\infty}\,e^{in(x-x')}\right)\,dx' \tag 3$$
Inasmuch as $(3)$ is true for all "test functions" $f$, then we deduce that
$$\bbox[5px,border:2px solid #C0A000]{\delta(x-x')=\frac{1}{2\pi}\,\sum_{n=-\infty}^{\infty}\,e^{in(x-x')}}$$
METHOD 2:
Assume that $f$ is a sufficiently smooth "test function" on $[-\pi,\pi]$. We examine the functional $\int_{-\pi}^\pi f(x)\left(\frac{1}{2\pi}\sum_{n=\infty}^{\infty}e^{in(x-a)}\right)\,dx$ in the sense of distributions. We have
$$\begin{align}
\int_{-\pi}^\pi f(x)\left(\frac{1}{2\pi}\sum_{n=\infty}^{\infty}e^{in(x-a)}\right)\,dx&=\frac{1}{2\pi}\lim_{N\to \infty}\int_{-\pi}^\pi f(x)\left(\frac{1}{2\pi}\sum_{n=n}^{N}e^{in(x-a)}\right)\,dx\\\\
&=\frac{1}{2\pi}\lim_{N\to \infty}\int_{-\pi}^\pi f(x)\left(\frac{1}{2\pi}\sum_{n=-N}^{N}e^{in(x-a)}\right)\,dx\\\\
&=\frac{1}{2\pi}\lim_{N\to \infty}\int_{-\pi}^\pi f(x)\left(\frac{\sin\left((N+1/2)(x-a)\right)}{\sin((x-a)/2)}\right)\,dx\\\\
&=\frac{1}{2\pi}\lim_{N\to \infty}\int_{-\pi}^\pi \sin\left((N+1/2)(x-a)\right)\left(\frac{f(x)-f(a)}{\sin((x-a)/2)}\right)\,dx\\\\
&+\frac{f(a)}{2\pi}\lim_{N\to \infty}\int_{-\pi}^\pi \left(\frac{\sin\left((N+1/2)(x-a)\right)}{\sin((x-a)/2)}\right)\,dx \tag 1\\\\
\end{align}$$
Now, if we assume that $\frac{f(x)-f(a)}{\sin((x-a)/2)}$ is absolutely integrable on $[-\pi,\pi]$, then by the Riemann-Lebesgue Lemma, the limit, as $N\to \infty$, of the first integral on the right-hand side of $(1)$ goes to zero.
The second integral is equal to $2\pi$ for all integer $N$. Therefore, for every suitable test function $f$, we have
$$\int_{-\pi}^\pi f(x)\left(\frac{1}{2\pi}\sum_{n=\infty}^{\infty}e^{in(x-a)}\right)\,dx=f(a)$$
Again, we deduce that for $x\in [-\pi,\pi]$,
$$\bbox[5px,border:2px solid #C0A000]{\delta(x-a)=\frac{1}{2\pi}\sum_{n=\infty}^{\infty}e^{in(x-a)}}$$
as expected!