Silence eslint compat/compat for search performance instrumentation

Eslint is throwing compat warnings on every commit in Vector. This
commit silences those warnings.

Change-Id: I0e914c6179745415e916fadd382d86baa72e3e63
This commit is contained in:
Nicholas Ray 2021-05-05 14:37:35 -06:00
parent bea00bc290
commit 8eba1da250
2 changed files with 5 additions and 0 deletions

View File

@ -15,9 +15,11 @@ var /** @type {VectorResourceLoaderVirtualConfig} */
// mediawiki.searchSuggest performance.
CAN_TEST_SEARCH = !!(
window.performance &&
/* eslint-disable compat/compat */
performance.mark &&
performance.measure &&
performance.getEntriesByName ),
/* eslint-enable compat/compat */
LOAD_START_MARK = 'mwVectorVueSearchLoadStart',
LOAD_END_MARK = 'mwVectorVueSearchLoadEnd',
LOAD_MEASURE = 'mwVectorVueSearchLoadStartToLoadEnd',

View File

@ -14,10 +14,12 @@ var INPUT_LOCATION_MOVED = 'header-moved',
// recorded on the Vector skin and only if browser supported.
shouldTestSearchPerformance = !!( window.performance &&
window.requestAnimationFrame &&
/* eslint-disable compat/compat */
performance.mark &&
performance.measure &&
performance.getEntriesByName &&
performance.clearMarks ),
/* eslint-enable compat/compat */
loadStartMark = 'mwVectorVueSearchLoadStart',
queryMark = 'mwVectorVueSearchQuery',
renderMark = 'mwVectorVueSearchRender',
@ -37,6 +39,7 @@ function onFetchStart() {
performance.clearMarks( queryMark );
}
/* eslint-disable-next-line compat/compat */
performance.mark( queryMark );
}