mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-24 23:55:53 +00:00
c9d5b2e4fb
Move all Vector JavaScript to ResourceLoader `packageFiles`[0] which are much more compatible with modern development practices: - The entrypoint is the first `packageFiles` entry (unless specified otherwise). All other JavaScript must be explicitly executed. - Remove a level of indentation due to IIFEs from every JavaScript file. Regretfully, ESLint does not support modules except in ES6+ so the otherwise useful `no-implicit-globals` rule must be disable. The change comes with a comment so we always remember. - IDEs and other tooling understand Node.js-like `module.exports` / `require()`. This change seemed the most sensible way to start developing new JavaScript in Vector needed by the collapsible sidebar. [0]: https://www.mediawiki.org/wiki/ResourceLoader/Package_modules Change-Id: I287e604d5b1055aa97b5f987c24872755757ea1a
18 lines
364 B
JSON
18 lines
364 B
JSON
{
|
|
"root": true,
|
|
"extends": [
|
|
"wikimedia/client",
|
|
"wikimedia/jquery",
|
|
"wikimedia/mediawiki"
|
|
],
|
|
"globals": {
|
|
"require": "readonly",
|
|
"module": "readonly"
|
|
},
|
|
"rules": {
|
|
"one-var": "off",
|
|
"//": ["off", "ResourceLoader's `packageFiles` do not require wrapping but the `module` option is only available in ES6+."],
|
|
"no-implicit-globals": "off"
|
|
}
|
|
}
|