Essentially lint checkers like nag
can only check what they know, they are not a full specification of the language.
In this case it doesn't know that, by design, any declaration form can be used as an environment, so while just using \footnotesize
is probably better and certainly more common, the environment form is also correct.
For font size commands it is usually best just to use the command without any grouping and rely on an outer environment
\begin{center}
\footnotesize
hello
\end{center}
here the close environment takes care of ending the paragraph in the scope of the size change.
If you go
{\footnotesize hello}
Then the size change ends before the paragraph so it is small text in a normal baseline, OK for a word but looks bad if there are any line breaks. You can use
{\footnotesize
}
But it is easy to forget and the environment form
\begin{footnotesize}
hello
\end{foootnotesize}
makes it perhaps even more likely to forget the blank line.
However it is still correct and if you know the paragraph ending isn't an issue, it can be useful,
\begin{footnotesize}
\begin{longtable}
.... thousand pages
\end{longtable}
\end{footnotesize}
Can make the source code easier to read than just having a trailing }
after the table, thousands of lines of source file later than the matching {
.
{\footnotesize <stuff>}
or put it inside a\begingroup
/\endgroup
pair.