diff --git a/.eslintignore b/.eslintignore index 8ab4750abd1685..5941496e1a6280 100644 --- a/.eslintignore +++ b/.eslintignore @@ -7,4 +7,5 @@ tools/icu tools/lint-md/lint-md.mjs benchmark/tmp doc/**/*.js +!doc/api_assets/*.js !.eslintrc.js diff --git a/doc/api_assets/api.js b/doc/api_assets/api.js index 9d6e8aa02dfc36..1816f7b2c79ce4 100644 --- a/doc/api_assets/api.js +++ b/doc/api_assets/api.js @@ -1,6 +1,6 @@ 'use strict'; - -// Check if we have Javascript support + +// Check if we have JavaScript support document.querySelector(':root').classList.add('has-js'); // Restore user mode preferences @@ -38,8 +38,8 @@ if (themeToggleButton) { // Handle pickers with click/taps rather than hovers const pickers = document.querySelectorAll('.picker-header'); -for(const picker of pickers) { - picker.addEventListener('click', e => { +for (const picker of pickers) { + picker.addEventListener('click', (e) => { if (!e.target.closest('.picker')) { e.preventDefault(); } @@ -57,7 +57,7 @@ for(const picker of pickers) { } // Track when the header is in sticky position -const header = document.querySelector(".header"); +const header = document.querySelector('.header'); let ignoreNextIntersection = false; new IntersectionObserver( ([e]) => { @@ -65,9 +65,9 @@ new IntersectionObserver( const newStatus = e.intersectionRatio < 1; // Same status, do nothing - if(currentStatus === newStatus) { + if (currentStatus === newStatus) { return; - } else if(ignoreNextIntersection) { + } else if (ignoreNextIntersection) { ignoreNextIntersection = false; return; } @@ -84,4 +84,4 @@ new IntersectionObserver( header.classList.toggle('is-pinned', newStatus); }, { threshold: [1] } -).observe(header); \ No newline at end of file +).observe(header);