diff --git a/.eslintrc.json b/.eslintrc.json
index 17f8508b..e67d292b 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -1,14 +1,14 @@
{
"root": true,
- "extends": "wikimedia",
+ "extends": [
+ "wikimedia",
+ "wikimedia/mediawiki",
+ "wikimedia/jquery"
+ ],
"env": {
"browser": true,
"commonjs": true
},
- "globals": {
- "mw": false,
- "$": false
- },
"rules": {
"no-shadow": "warn"
}
diff --git a/.phpcs.xml b/.phpcs.xml
index 5b7a5681..ca97268f 100644
--- a/.phpcs.xml
+++ b/.phpcs.xml
@@ -1,7 +1,10 @@
-
+
+
+
+
.
-
+
diff --git a/composer.json b/composer.json
index 0971aa84..467bfdb8 100644
--- a/composer.json
+++ b/composer.json
@@ -1,6 +1,6 @@
{
"require-dev": {
- "mediawiki/mediawiki-codesniffer": "31.0.0",
+ "mediawiki/mediawiki-codesniffer": "32.0.0",
"mediawiki/mediawiki-phan-config": "0.10.3",
"mediawiki/minus-x": "1.1.0",
"php-parallel-lint/php-console-highlighter": "0.5.0",
diff --git a/includes/CategoryTreeHooks.php b/includes/CategoryTreeHooks.php
index e9927230..e8a5f398 100644
--- a/includes/CategoryTreeHooks.php
+++ b/includes/CategoryTreeHooks.php
@@ -154,6 +154,7 @@ class CategoryTreeHooks {
) {
if ( $parser ) {
# flag for use by CategoryTreeHooks::parserOutput
+ // @phan-suppress-next-line PhanUndeclaredProperty
$parser->mOutput->mCategoryTreeTag = true;
}
@@ -187,6 +188,7 @@ class CategoryTreeHooks {
// Skip, we've already set the headers unconditionally
return;
}
+ // @phan-suppress-next-line PhanUndeclaredProperty
if ( !empty( $parserOutput->mCategoryTreeTag ) ) {
CategoryTree::setHeaders( $outputPage );
}
diff --git a/modules/ext.categoryTree/ext.categoryTree.js b/modules/ext.categoryTree/ext.categoryTree.js
index 537c5804..496a6eab 100644
--- a/modules/ext.categoryTree/ext.categoryTree.js
+++ b/modules/ext.categoryTree/ext.categoryTree.js
@@ -85,7 +85,7 @@
*/
function attachHandler( $content ) {
$content.find( '.CategoryTreeToggle' )
- .click( handleNode )
+ .on( 'click', handleNode )
.attr( 'title', function () {
return mw.msg(
$( this ).data( 'ct-state' ) === 'collapsed' ?
@@ -134,7 +134,8 @@
$link.data( 'ct-loaded', true );
$children.empty().append(
- $( '' )
+ $( '' )
+ .addClass( 'CategoryTreeNotice' )
.text( mw.msg( 'categorytree-loading' ) )
);
@@ -184,7 +185,7 @@
data = mw.msg( 'categorytree-nothing-found' );
}
- $data = $( '' ).text( data );
+ $data = $( '' ).addClass( 'CategoryTreeNotice' ).text( data );
} else {
$data = $( $.parseHTML( data ) );
attachHandler( $data );
@@ -204,6 +205,7 @@
$( function () {
// Attach click handler for sidebar
+ // eslint-disable-next-line no-jquery/no-global-selector
attachHandler( $( '#p-categorytree-portlet' ) );
} );