Originally Posted by
TransWorld
Here is what Merrian Webster says:
https://www.merriam-webster.com/dictionary/illegal
It says it is an adjective.
It defines it as: not according to or authorized by law : unlawful, illicit; also : not sanctioned by official rules (as of a game)
Not sure where you got your part of speech or definition.

From the same link you posted. Just scroll down a little further and you'll see a second definition ... as a noun.