[eslint] Disable mediawiki/class-doc
Given our use of constants for tracking classes this eslint rule is more an annoyance than helpful. Change-Id: I37570e3e851997d058f2d93777990dddb3d04089
This commit is contained in:
parent
d4fb2960d6
commit
52c7c2ee75
|
@ -11,6 +11,7 @@
|
||||||
"ResourceLoader's `packageFiles` do not require wrapping but the `module` option is only available in ES6+."
|
"ResourceLoader's `packageFiles` do not require wrapping but the `module` option is only available in ES6+."
|
||||||
],
|
],
|
||||||
"no-implicit-globals": "off",
|
"no-implicit-globals": "off",
|
||||||
"compat/compat": "warn"
|
"compat/compat": "warn",
|
||||||
|
"mediawiki/class-doc": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,5 +17,8 @@
|
||||||
"VectorHeaderObserver": "VectorHeaderObserver"
|
"VectorHeaderObserver": "VectorHeaderObserver"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"rules": {
|
||||||
|
"mediawiki/class-doc": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,6 @@ function bindSearchBoxHandler( searchBox, header ) {
|
||||||
!ev.target.closest( '.wvui-typeahead-suggestion' ) &&
|
!ev.target.closest( '.wvui-typeahead-suggestion' ) &&
|
||||||
!searchBox.contains( ev.target )
|
!searchBox.contains( ev.target )
|
||||||
) {
|
) {
|
||||||
// eslint-disable-next-line mediawiki/class-doc
|
|
||||||
header.classList.remove( SEARCH_VISIBLE_CLASS );
|
header.classList.remove( SEARCH_VISIBLE_CLASS );
|
||||||
|
|
||||||
document.removeEventListener( 'click', clickHandler );
|
document.removeEventListener( 'click', clickHandler );
|
||||||
|
@ -54,7 +53,6 @@ function bindToggleClickHandler( searchBox, header, searchToggle ) {
|
||||||
// from the page when clicked.
|
// from the page when clicked.
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
|
|
||||||
// eslint-disable-next-line mediawiki/class-doc
|
|
||||||
header.classList.add( SEARCH_VISIBLE_CLASS );
|
header.classList.add( SEARCH_VISIBLE_CLASS );
|
||||||
|
|
||||||
// Defer binding the search box handler until after the event bubbles to the
|
// Defer binding the search box handler until after the event bubbles to the
|
||||||
|
|
|
@ -35,10 +35,8 @@ function copyAttribute( from, to, attribute ) {
|
||||||
*/
|
*/
|
||||||
function show() {
|
function show() {
|
||||||
if ( header ) {
|
if ( header ) {
|
||||||
// eslint-disable-next-line mediawiki/class-doc
|
|
||||||
header.classList.add( STICKY_HEADER_VISIBLE_CLASS );
|
header.classList.add( STICKY_HEADER_VISIBLE_CLASS );
|
||||||
}
|
}
|
||||||
// eslint-disable-next-line mediawiki/class-doc
|
|
||||||
document.body.classList.remove( ULS_HIDE_CLASS );
|
document.body.classList.remove( ULS_HIDE_CLASS );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,9 +45,7 @@ function show() {
|
||||||
*/
|
*/
|
||||||
function hide() {
|
function hide() {
|
||||||
if ( header ) {
|
if ( header ) {
|
||||||
// eslint-disable-next-line mediawiki/class-doc
|
|
||||||
header.classList.remove( STICKY_HEADER_VISIBLE_CLASS );
|
header.classList.remove( STICKY_HEADER_VISIBLE_CLASS );
|
||||||
// eslint-disable-next-line mediawiki/class-doc
|
|
||||||
document.body.classList.add( ULS_HIDE_CLASS );
|
document.body.classList.add( ULS_HIDE_CLASS );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -112,7 +108,6 @@ function removeNode( node ) {
|
||||||
*/
|
*/
|
||||||
function removeClassFromNodes( nodes, className ) {
|
function removeClassFromNodes( nodes, className ) {
|
||||||
Array.prototype.forEach.call( nodes, function ( node ) {
|
Array.prototype.forEach.call( nodes, function ( node ) {
|
||||||
// eslint-disable-next-line mediawiki/class-doc
|
|
||||||
node.classList.remove( className );
|
node.classList.remove( className );
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
|
@ -124,12 +119,9 @@ function removeClassFromNodes( nodes, className ) {
|
||||||
* @param {string} status 'watched', 'unwatched', or 'temporary'
|
* @param {string} status 'watched', 'unwatched', or 'temporary'
|
||||||
*/
|
*/
|
||||||
function updateStickyWatchlink( watchSticky, status ) {
|
function updateStickyWatchlink( watchSticky, status ) {
|
||||||
/* eslint-disable mediawiki/class-doc */
|
|
||||||
watchSticky.classList.toggle( 'mw-ui-icon-wikimedia-star', status === 'unwatched' );
|
watchSticky.classList.toggle( 'mw-ui-icon-wikimedia-star', status === 'unwatched' );
|
||||||
watchSticky.classList.toggle( 'mw-ui-icon-wikimedia-unStar', status === 'watched' );
|
watchSticky.classList.toggle( 'mw-ui-icon-wikimedia-unStar', status === 'watched' );
|
||||||
watchSticky.classList.toggle( 'mw-ui-icon-wikimedia-halfStar', status === 'temporary' );
|
watchSticky.classList.toggle( 'mw-ui-icon-wikimedia-halfStar', status === 'temporary' );
|
||||||
/* eslint-enable mediawiki/class-doc */
|
|
||||||
|
|
||||||
watchSticky.setAttribute( 'data-event-name', status === 'unwatched' ? 'watch-sticky-header' : 'unwatch-sticky-header' );
|
watchSticky.setAttribute( 'data-event-name', status === 'unwatched' ? 'watch-sticky-header' : 'unwatch-sticky-header' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -396,7 +388,6 @@ function makeStickyHeaderFunctional(
|
||||||
const primaryEdit = protectedEdit || ( veEdit || ceEdit );
|
const primaryEdit = protectedEdit || ( veEdit || ceEdit );
|
||||||
const secondaryEdit = veEdit ? ceEdit : null;
|
const secondaryEdit = veEdit ? ceEdit : null;
|
||||||
const disableStickyHeader = () => {
|
const disableStickyHeader = () => {
|
||||||
// eslint-disable-next-line mediawiki/class-doc
|
|
||||||
headerElement.classList.remove( STICKY_HEADER_VISIBLE_CLASS );
|
headerElement.classList.remove( STICKY_HEADER_VISIBLE_CLASS );
|
||||||
stickyObserver.unobserve( stickyIntersection );
|
stickyObserver.unobserve( stickyIntersection );
|
||||||
};
|
};
|
||||||
|
|
|
@ -54,19 +54,15 @@ module.exports = function tableOfContents( props ) {
|
||||||
const parentSection = /** @type {HTMLElement} */ ( tocSection.closest( `.${PARENT_SECTION_CLASS}` ) );
|
const parentSection = /** @type {HTMLElement} */ ( tocSection.closest( `.${PARENT_SECTION_CLASS}` ) );
|
||||||
|
|
||||||
if ( activeChildSection ) {
|
if ( activeChildSection ) {
|
||||||
// eslint-disable-next-line mediawiki/class-doc
|
|
||||||
activeChildSection.classList.remove( ACTIVE_SECTION_CLASS );
|
activeChildSection.classList.remove( ACTIVE_SECTION_CLASS );
|
||||||
}
|
}
|
||||||
if ( activeParentSection ) {
|
if ( activeParentSection ) {
|
||||||
// eslint-disable-next-line mediawiki/class-doc
|
|
||||||
activeParentSection.classList.remove( ACTIVE_SECTION_CLASS );
|
activeParentSection.classList.remove( ACTIVE_SECTION_CLASS );
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line mediawiki/class-doc
|
|
||||||
tocSection.classList.add( ACTIVE_SECTION_CLASS );
|
tocSection.classList.add( ACTIVE_SECTION_CLASS );
|
||||||
|
|
||||||
if ( parentSection ) {
|
if ( parentSection ) {
|
||||||
// eslint-disable-next-line mediawiki/class-doc
|
|
||||||
parentSection.classList.add( ACTIVE_SECTION_CLASS );
|
parentSection.classList.add( ACTIVE_SECTION_CLASS );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,6 @@ function addPortletLinkHandler( item, data ) {
|
||||||
if ( isIconCapable && data.id && link ) {
|
if ( isIconCapable && data.id && link ) {
|
||||||
// If class was previously added this will be a no-op so it is safe to call even
|
// If class was previously added this will be a no-op so it is safe to call even
|
||||||
// if we've previously enhanced it.
|
// if we've previously enhanced it.
|
||||||
// eslint-disable-next-line mediawiki/class-doc
|
|
||||||
link.classList.add(
|
link.classList.add(
|
||||||
'mw-ui-icon',
|
'mw-ui-icon',
|
||||||
'mw-ui-icon-before',
|
'mw-ui-icon-before',
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
* That doesn't happen in this file but the linter still throws an error.
|
* That doesn't happen in this file but the linter still throws an error.
|
||||||
* https://github.com/wikimedia/eslint-plugin-mediawiki/blob/master/docs/rules/class-doc.md
|
* https://github.com/wikimedia/eslint-plugin-mediawiki/blob/master/docs/rules/class-doc.md
|
||||||
*/
|
*/
|
||||||
/* eslint-disable mediawiki/class-doc */
|
|
||||||
|
|
||||||
/** @interface VectorResourceLoaderVirtualConfig */
|
/** @interface VectorResourceLoaderVirtualConfig */
|
||||||
/** @interface MediaWikiPageReadyModule */
|
/** @interface MediaWikiPageReadyModule */
|
||||||
|
|
Loading…
Reference in New Issue