Allow Prettier default for trailing commas, run Prettier on repo

per convo with @claviska
This commit is contained in:
Lea Verou
2024-12-14 17:08:29 -05:00
parent b5d1a71f46
commit b0c4c7263b
151 changed files with 503 additions and 519 deletions

View File

@@ -13,7 +13,7 @@ const matchers = {
regexp(textContent, query) {
query.lastIndex = 0;
return query.test(textContent);
}
},
};
matchers.iregexp = matchers.regexp; // i is baked into the query

View File

@@ -43,7 +43,7 @@ document.addEventListener('click', event => {
js_pre_processor: 'none',
html,
css,
js
js,
};
const input = document.createElement('input');

View File

@@ -79,8 +79,8 @@
diffViewer.appendChild(
createDiff({
serverHTML,
clientHTML
})
clientHTML,
}),
);
});
}
@@ -88,7 +88,7 @@
function createDiff({ serverHTML, clientHTML }) {
const diff = diffLines(serverHTML, clientHTML, {
ignoreWhitespace: false,
newLineIsToken: true
newLineIsToken: true,
});
const fragment = document.createDocumentFragment();
for (var i = 0; i < diff.length; i++) {

View File

@@ -11,7 +11,7 @@
const newStylesheet = Object.assign(document.createElement('link'), {
href: `/dist/styles/themes/${presetTheme}.css`,
rel: 'preload',
as: 'style'
as: 'style',
});
newStylesheet.addEventListener(
@@ -23,7 +23,7 @@
stylesheet.remove();
});
},
{ once: true }
{ once: true },
);
document.head.append(newStylesheet);

View File

@@ -15,7 +15,7 @@ document.addEventListener('click', event => {
event.preventDefault();
window.scroll({
top: target.offsetTop - headerHeight,
behavior: 'smooth'
behavior: 'smooth',
});
history.pushState(undefined, undefined, `#${id}`);
}

View File

@@ -9,7 +9,7 @@ const icons = {
component: 'puzzle-piece',
document: 'file',
home: 'house',
theme: 'palette'
theme: 'palette',
};
let searchTimeout;
@@ -18,7 +18,7 @@ function getElements() {
return {
dialog: document.getElementById('site-search'),
input: document.getElementById('site-search-input'),
results: document.getElementById('site-search-listbox')
results: document.getElementById('site-search-listbox'),
};
}

View File

@@ -9,7 +9,7 @@ function saveScrollPosition() {
if (element.id) {
positions[element.id] = {
top: element.scrollTop,
left: element.scrollLeft
left: element.scrollLeft,
};
} else {
console.warn(`Can't save scroll position for elements without an id.`, el);