We have files in Git with no extension that are actually wikitext and others that are plain text. Other files end in .txt (which doxygen garbles, T106116: The Doxygen version in CI parses README files as garbled C.); some are actually wikitext, and others are structured text.
Per Manual:Coding conventions#Text files (wut spage wrote), actual wikitext files should end with .wiki (.mediawiki also works on GitHub but we prefer shorter), and most plain text files could easily be massaged into Markdown files that should end with .md. (If a text file is neither Markdown nor wikitext, then it's better to have a .txt extension, but it's not worth renaming 132 extensions' COPYING files to COPYING.txt.)
I think it's pretty safe to git mv files in core to give them the right extension, hence tagging this easy. The doc is only regenerated on +2, so you should test your changes locally: install the same version of doxygen that jenkins-bot's https://integration.wikimedia.org/ci/job/mediawiki-core-doxygen-publish/12245/console | mediawiki-core-doxygen-publish task uses (sample run), then rebuild core's documentation with maintenance/mwdocgen.php.