So, I noticed that CalebJohn recently added support for code mirror content script plugins to Joplin. Spent some time on it and was able to create the line number enablement plugin
Anyone else interested can get it from here: Release 1.0.0 路 shantanugoel/joplin-plugin-cm-linenumbers 路 GitHub
Code is at: joplin-plugin-cm-linenumbers/src at main 路 shantanugoel/joplin-plugin-cm-linenumbers 路 GitHub