It is well known that the first $N$ terms of a Fourier series of an even function $f$ corresponds to the least squares approximation of $f$ on $[-\pi,\pi]$ using the functions $S = \{1,\cos(x), \cos(2x),\dots,\cos(Nx)\}$.
The least squares method doesn't make sense for approximating the delta function, since
$$\int_{-\pi}^\pi(f(x)-\delta(x))^2\,dx$$
diverges. However, the Fourier series technique can approximate this distribution without issue. Moreover, one can populate the least-squares matrix with values when approximating the delta function. In what sense, then, is the Fourier series approximating the delta function? Is there a generalized "least-squares" that will quantify how close a function is to the delta function?
Generally in Banach spaces $\|u\|=\sup_{\|l\|=1}|\langle l,u\rangle|$, which means that least squares solution realizes $\inf_u\sup_{\|l\|=1}|\langle l,u\rangle|$, where $l$ runs over the unit ball of the dual space. Just having $|\langle l,u_n\rangle|$ go to $0$ for any dual $l$ makes sense for Sobolev spaces to which $f(x)-\delta(x)$ belongs, and their duals, it even makes sense for more general locally convex spaces to which distributions belong. If one wants a single measure of deviation Fréchet metric can be used in many cases (when the space has a countable basis of seminorms).
$f(x)-\delta(x)$ belongs to $H^{-1}$, for example, from the standard Hilbert scale $H^k$. It is straightforward to see that there will be weak convergence of the Fourier series to it, i.e. if $l$-s are taken from $H^{1}$ (it may not converge by norm in $H^{-1}$ in all cases). Alternatively, one can use weak convergence of measures, their space is dual to $C^0$. Both convergences are metrizable (on bounded subsets), see e.g. Metrization of weak convergence of signed measures on MO.