Discourage jQuery usage in Popups extension

Change-Id: Iff0c81e4c1d78cc52d1bd9d81e24d8fae228c9bc
This commit is contained in:
Jon Robson 2023-06-13 15:39:41 -07:00
parent e8204a5aca
commit 580067b94e
7 changed files with 70 additions and 21 deletions

View file

@ -1,9 +1,13 @@
{
"root": true,
"plugins": [
"no-jquery"
],
"extends": [
"wikimedia/common",
"wikimedia/language/es6",
"wikimedia/jquery",
"plugin:no-jquery/all",
"wikimedia/mediawiki"
],
"parserOptions": {
@ -14,6 +18,18 @@
"commonjs": true
},
"rules": {
"no-jquery/no-jquery-constructor": "error",
"no-jquery/no-find-collection": "error",
"no-jquery/no-attr": "error",
"no-jquery/no-class": "error",
"no-jquery/no-text": "error",
"no-jquery/no-css": "error",
"no-jquery/no-other-methods": "error",
"no-jquery/no-html": "error",
"no-jquery/no-class-state": "error",
"no-jquery/no-deferred": "error",
"no-jquery/no-when": "error",
"no-jquery/no-extend": "error",
"compat/compat": "off",
"no-use-before-define": "off",
"jsdoc/no-undefined-types": "off",

61
package-lock.json generated
View file

@ -28,6 +28,7 @@
"cssjanus": "1.3.1",
"eslint": "8.31.0",
"eslint-config-wikimedia": "0.25.0",
"eslint-plugin-no-jquery": "2.7.0",
"expose-loader": "0.7.5",
"grunt-banana-checker": "0.11.0",
"jquery": "3.6.1",
@ -28710,7 +28711,8 @@
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/@csstools/selector-specificity/-/selector-specificity-2.2.0.tgz",
"integrity": "sha512-+OJ9konv95ClSTOJCmMZqpd5+YGsB2S+x6w3E1oaM8UuR5j8nTNHYSz8c9BEPGDOCMQYIEEGlVPj/VY64iTbGw==",
"dev": true
"dev": true,
"requires": {}
},
"@discoveryjs/json-ext": {
"version": "0.5.7",
@ -32470,7 +32472,8 @@
"version": "0.11.0",
"resolved": "https://registry.npmjs.org/@wikimedia/codex/-/codex-0.11.0.tgz",
"integrity": "sha512-DYI9ewtEqNykzYp1nMcyrtbKpGbVPTWkbxV9QJIDIDe2GayA8XbfK/7u0V5cnTU90iqCLwqsEnQZiXX4QDvsWg==",
"dev": true
"dev": true,
"requires": {}
},
"@wikimedia/codex-icons": {
"version": "0.11.0",
@ -32558,7 +32561,8 @@
"version": "5.3.2",
"resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz",
"integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==",
"dev": true
"dev": true,
"requires": {}
},
"acorn-walk": {
"version": "7.2.0",
@ -32632,13 +32636,15 @@
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.1.tgz",
"integrity": "sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ==",
"dev": true
"dev": true,
"requires": {}
},
"ajv-keywords": {
"version": "3.5.2",
"resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz",
"integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==",
"dev": true
"dev": true,
"requires": {}
},
"ansi-align": {
"version": "3.0.1",
@ -36709,7 +36715,8 @@
"version": "2.7.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-no-jquery/-/eslint-plugin-no-jquery-2.7.0.tgz",
"integrity": "sha512-Aeg7dA6GTH1AcWLlBtWNzOU9efK5KpNi7b0EhBO0o0M+awyzguUUo8gF6hXGjQ9n5h8/uRtYv9zOqQkeC5CG0w==",
"dev": true
"dev": true,
"requires": {}
},
"eslint-plugin-node": {
"version": "11.1.0",
@ -37129,7 +37136,8 @@
"version": "0.7.5",
"resolved": "https://registry.npmjs.org/expose-loader/-/expose-loader-0.7.5.tgz",
"integrity": "sha512-iPowgKUZkTPX5PznYsmifVj9Bob0w2wTHVkt/eYNPSzyebkUgIedmskf/kcfEIWpiWjg3JRjnW+a17XypySMuw==",
"dev": true
"dev": true,
"requires": {}
},
"express": {
"version": "4.17.3",
@ -41052,13 +41060,15 @@
"version": "8.6.2",
"resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-8.6.2.tgz",
"integrity": "sha512-JNaekTlIwwyYGBN3zifZDxgz4bSL8sbEj58fdTZGmPSMMGXBZapFjcZk2I33Jy79c1fvCKHpF7MA/67FOTjvzA==",
"dev": true
"dev": true,
"requires": {}
},
"markdown-to-jsx": {
"version": "7.1.7",
"resolved": "https://registry.npmjs.org/markdown-to-jsx/-/markdown-to-jsx-7.1.7.tgz",
"integrity": "sha512-VI3TyyHlGkO8uFle0IOibzpO1c1iJDcXcS/zBrQrXQQvJ2tpdwVzVZ7XdKsyRz1NdRmre4dqQkMZzUHaKIG/1w==",
"dev": true
"dev": true,
"requires": {}
},
"marked": {
"version": "4.0.14",
@ -42966,7 +42976,8 @@
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/postcss-less/-/postcss-less-6.0.0.tgz",
"integrity": "sha512-FPX16mQLyEjLzEuuJtxA8X3ejDLNGGEG503d2YGZR5Ask1SpDN8KmZUMpzCvyalWRywAn1n1VOA5dcqfCLo5rg==",
"dev": true
"dev": true,
"requires": {}
},
"postcss-loader": {
"version": "4.3.0",
@ -43143,7 +43154,8 @@
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/postcss-safe-parser/-/postcss-safe-parser-6.0.0.tgz",
"integrity": "sha512-FARHN8pwH+WiS2OPCxJI8FuRJpTVnn6ZNFiqAM2aeW2LwTHWWmWgIyKC6cUo0L8aeKiF/14MNvnpls6R2PBeMQ==",
"dev": true
"dev": true,
"requires": {}
},
"postcss-selector-parser": {
"version": "6.0.11",
@ -43637,7 +43649,8 @@
"version": "7.5.7",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.5.7.tgz",
"integrity": "sha512-KMvVuFzpKBuiIXW3E4u3mySRO2/mCHSyZDJQM5NQ9Q9KHWHWh0NHgfbRMLLrceUK5qAL4ytALJbpRMjixFZh8A==",
"dev": true
"dev": true,
"requires": {}
}
}
},
@ -43805,7 +43818,8 @@
"version": "5.5.1",
"resolved": "https://registry.npmjs.org/react-colorful/-/react-colorful-5.5.1.tgz",
"integrity": "sha512-M1TJH2X3RXEt12sWkpa6hLc/bbYS0H6F4rIqjQZ+RxNBstpY67d9TrFXtqdZwhpmBXcCwEi7stKqFue3ZRkiOg==",
"dev": true
"dev": true,
"requires": {}
},
"react-dom": {
"version": "16.14.0",
@ -45911,7 +45925,8 @@
"version": "9.0.0",
"resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-9.0.0.tgz",
"integrity": "sha512-9YQSrJq4NvvRuTbzDsWX3rrFOzOlYBmZP+o513BJN/yfEmGSr0AxdvrWs0P/ilSpVV/wisamAHu5XSk8Rcf4CQ==",
"dev": true
"dev": true,
"requires": {}
},
"stylelint-config-wikimedia": {
"version": "0.15.0",
@ -46678,7 +46693,8 @@
}
},
"typescript": {
"version": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz",
"version": "4.9.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz",
"integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==",
"dev": true,
"peer": true
@ -47082,13 +47098,15 @@
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/use-composed-ref/-/use-composed-ref-1.2.1.tgz",
"integrity": "sha512-6+X1FLlIcjvFMAeAD/hcxDT8tmyrWnbSPMU0EnxQuDLIxokuFzWliXBiYZuGIx+mrAMLBw0WFfCkaPw8ebzAhw==",
"dev": true
"dev": true,
"requires": {}
},
"use-isomorphic-layout-effect": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/use-isomorphic-layout-effect/-/use-isomorphic-layout-effect-1.1.2.tgz",
"integrity": "sha512-49L8yCO3iGT/ZF9QttjwLF/ZD9Iwto5LnH5LmEdk/6cFmXddqi2ulF0edxTwjj+7mqvpVVGQWvbXZdn32wRSHA==",
"dev": true
"dev": true,
"requires": {}
},
"use-latest": {
"version": "1.2.0",
@ -47243,7 +47261,8 @@
"dev": true
},
"vue": {
"version": "https://registry.npmjs.org/vue/-/vue-3.3.2.tgz",
"version": "3.3.2",
"resolved": "https://registry.npmjs.org/vue/-/vue-3.3.2.tgz",
"integrity": "sha512-98hJcAhyDwZoOo2flAQBSPVYG/o0HA9ivIy2ktHshjE+6/q8IMQ+kvDKQzOZTFPxvnNMcGM+zS2A00xeZMA7tA==",
"dev": true,
"peer": true,
@ -48226,7 +48245,8 @@
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/webpack-filter-warnings-plugin/-/webpack-filter-warnings-plugin-1.2.1.tgz",
"integrity": "sha512-Ez6ytc9IseDMLPo0qCuNNYzgtUl8NovOqjIq4uAU8LTD4uoa1w1KpZyyzFtLTEMZpkkOkLfL9eN+KGYdk1Qtwg==",
"dev": true
"dev": true,
"requires": {}
},
"webpack-hot-middleware": {
"version": "2.25.1",
@ -48497,7 +48517,8 @@
"version": "8.5.0",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.5.0.tgz",
"integrity": "sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==",
"dev": true
"dev": true,
"requires": {}
},
"xml-name-validator": {
"version": "4.0.0",

View file

@ -49,6 +49,7 @@
"cssjanus": "1.3.1",
"eslint": "8.31.0",
"eslint-config-wikimedia": "0.25.0",
"eslint-plugin-no-jquery": "2.7.0",
"expose-loader": "0.7.5",
"grunt-banana-checker": "0.11.0",
"jquery": "3.6.1",

Binary file not shown.

View file

@ -26,7 +26,6 @@ function createFooterLink() {
// From https://en.wikipedia.org/wiki/MediaWiki:Gadget-ReferenceTooltips.js,
// which was written by Yair rand <https://en.wikipedia.org/wiki/User:Yair_rand>.
// eslint-disable-next-line no-jquery/no-global-selector
let footer = document.querySelector( '#footer-places, #f-list' );
if ( !footer ) {

View file

@ -3,6 +3,17 @@
"wikimedia/qunit"
],
"rules": {
"no-jquery/no-jquery-constructor": "off",
"no-jquery/no-find-collection": "off",
"no-jquery/no-attr": "off",
"no-jquery/no-class": "off",
"no-jquery/no-text": "off",
"no-jquery/no-css": "off",
"no-jquery/no-other-methods": "off",
"no-jquery/no-html": "off",
"no-jquery/no-deferred": "warn",
"no-jquery/no-when": "warn",
"no-jquery/no-extend": "warn",
"no-jquery/no-class-state": "off",
"es-x/no-hashbang": "warn"
}

View file

@ -7,6 +7,7 @@
"mw": "readonly"
},
"rules": {
"no-jquery/no-jquery-constructor": "off",
"wdio/no-pause": "warn"
}
}