MobileFrontend components are inseparable from jQuery. Its usage has encouraged building features in a way that is both verbose and challenging to reason about, and discourages composition. In some cases, the results of our best devs have been nearly incoherent. Additionally, the outputs of the API often return more API-specific types that imply further usage such that any interaction compounds. All of this and large jQuery runtime dependencies. For these reasons, new usages of jQuery should be the exception rather than a rule. Further, jQuery usage from within components should be totally forbidden to avoid the shortcomings of previous frameworks (see T225453).
eslint-config-wikimedia provides a forked wrapper around eslint-plugin-jquery to minimize jQuery but this task posits a bolder approach for all new JavaScript written: no jQuery at all which seems more practical than ever given the Vue.js baseline.
Acceptance criteria
- ESLint is configured to forbid all jQuery interactions.
- Exceptions are added to the existing Vector jQuery plugin.
- Adding any jQuery anywhere else causes npm t to fail.
- The wiki is updated to clarify that jQuery cannot be a dependency of components as a design goal.