If a user .js page (such as User:Foo/monobook.js) contains something that looks like template transclusion syntax, it is apparently parsed as such behind the scenes when the page is saved. The transcluded template is never actually shown to the user, since such pages are shown as raw wikitext, but if the template contains any category links, the .js page gets placed in those categories (although no categories are shown on the page itself) and is listed on Special:Whatlinkshere as transclusing the template.
Fixing this properly may be somewhat tricky, since the fact that wikilinks (including category links) and {{subst:...}} are parsed even on user .js pages is generally considered a desirable feature. (The former is used for keeping track of which user .js pages include which scripts, while the latter is used for including standard boilerplate code.) Ideally, the pages should probably go through the pre-save transform (for "subst:") and get parsed for wikilinks, but not for (non-subst) transclusions.
As a workaround, any occurrences of "{{" in user JavaScript may be mangled (for example as "{"+"{") or the entire script (or just the affected parts) may be wrapped in commented-out <nowiki> tags. However, using <nowiki> also disables subst: and link tracking.
Example pages:
- User:Ilmari Karonen/foo.js
- User:Ilmari Karonen/Template with category
- Category:Wikipedia user Ilmari Karonen's nonexistent test category
See also
- T18683: User CSS/JS should not be parsed for link tables without rendering
- T19525: css and .js pages should not store entries in Categorylinks table/Templatelinks table
- T34450: Scripts pages in MediaWiki: namespace parsed like wiki pages
- WP:Village pump (technical)/Archive AH#Problem with monobook.js files