build: Updating mediawiki/mediawiki-codesniffer to 32.0.0

The following sniffs are failing and were disabled:
* MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationPublic
* MediaWiki.Usage.ExtendClassUsage.FunctionConfigUsage

Additional changes:
* Dropped .inc files from .phpcs.xml (T200956).
* Added the `wikimedia/mediawiki` profile in .eslintrc.json (T262222).
* Added the `wikimedia/jquery` profile in .eslintrc.json (T262222).
* Removed global `$`, included in the `wikimedia/jquery` profile (T262222).
* Removed global `mw`, included via `wikimedia/mediawiki` profile (T262222).
* Dropped the emtpy global definition in .eslintrc.json.

Change-Id: Ib5a3697712078a4ed22195c274eae9c82ddd7227
This commit is contained in:
libraryupgrader 2020-10-29 06:41:31 +00:00 committed by Thiemo Kreuz (WMDE)
parent bb73d3dde7
commit 44998a759a
5 changed files with 18 additions and 11 deletions

View file

@ -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"
}

View file

@ -1,7 +1,10 @@
<?xml version="1.0"?>
<ruleset>
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki" />
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
<exclude name="MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationPublic" />
<exclude name="MediaWiki.Usage.ExtendClassUsage.FunctionConfigUsage" />
</rule>
<file>.</file>
<arg name="extensions" value="php,inc" />
<arg name="extensions" value="php" />
<arg name="encoding" value="UTF-8" />
</ruleset>

View file

@ -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",

View file

@ -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 );
}

View file

@ -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(
$( '<i class="CategoryTreeNotice"></i>' )
$( '<i>' )
.addClass( 'CategoryTreeNotice' )
.text( mw.msg( 'categorytree-loading' ) )
);
@ -184,7 +185,7 @@
data = mw.msg( 'categorytree-nothing-found' );
}
$data = $( '<i class="CategoryTreeNotice"></i>' ).text( data );
$data = $( '<i>' ).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' ) );
} );