Rules
Every rule from ESLint, Oxlint and Biome. Pick a rule to see its example. Reach is the weekly npm downloads of the presets that enable a rule; trend is its change over the last quarter.
Every rule from ESLint, Oxlint and Biome. Pick a rule to see its example. Reach is the weekly npm downloads of the presets that enable a rule; trend is its change over the last quarter.
window.addEventListener('resize', () => {
element.classList.toggle('is-small', element.offsetWidth < 500);
});new ResizeObserver(entries => {
for (const entry of entries) {
entry.target.classList.toggle('is-small', entry.contentRect.width < 500);
}
}).observe(element);Popular · 1 of 48
Prefer observer APIs over resize and scroll listeners with layout reads.
window.addEventListener('resize', () => {
element.classList.toggle('is-small', element.offsetWidth < 500);
});new ResizeObserver(entries => {
for (const entry of entries) {
entry.target.classList.toggle('is-small', entry.contentRect.width < 500);
}
}).observe(element);