1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2026-06-29 23:45:58 -04:00

much stricter eslint'ing (adapted from eslint-config-google and some airbnb)

This commit is contained in:
2021-08-18 10:58:20 -04:00
parent 16bff324a2
commit 4a7c9d4d96
15 changed files with 158 additions and 53 deletions
+3 -2
View File
@@ -24,8 +24,9 @@ if (ClipboardJS.isSupported()) {
new ClipboardJS("button.copy-button", {
// actual code element will (should) have class "language-*", even if plaintext
// eslint-disable-next-line quotes
text: (trigger) => trimNewlines(trigger.parentElement.querySelector('code[class^="language-"]').innerText),
text: (trigger) =>
// eslint-disable-next-line quotes
trimNewlines(trigger.parentElement.querySelector('code[class^="language-"]').innerText),
}).on("success", (e) => {
// show a subtle indication of success
e.trigger.innerText = successTerm;
+2 -6
View File
@@ -27,15 +27,11 @@ if (wrapper && canonical) {
// finally inject the hits...
const counter = document.getElementById("hit-counter");
if (counter) {
counter.appendChild(document.createTextNode(hitsComma));
}
if (counter) counter.appendChild(document.createTextNode(hitsComma));
// ...and hide the loading spinner
const spinner = document.getElementById("hit-spinner");
if (spinner) {
spinner.style.display = "none";
}
if (spinner) spinner.style.display = "none";
} else {
// something went horribly wrong, initiate coverup
wrapper.style.display = "none";
+5 -7
View File
@@ -14,9 +14,7 @@ if (wrapper) {
<a class="repo-name" href="${repo.url}" target="_blank" rel="noopener">${repo.name}</a>
${(() => {
if (repo.description) {
return html`<p class="repo-description">${repo.description}</p>`;
}
if (repo.description) return html`<p class="repo-description">${repo.description}</p>`;
})()}
${(() => {
if (repo.language) {
@@ -60,7 +58,9 @@ if (wrapper) {
})()}
<div class="repo-meta" title="${format(parseJSON(repo.updatedAt), "MMM d, yyyy, h:mm aa z")}">
<span>Updated ${formatDistanceToNowStrict(parseJSON(repo.updatedAt), { addSuffix: true })}</span>
<span>
Updated ${formatDistanceToNowStrict(parseJSON(repo.updatedAt), { addSuffix: true })}
</span>
</div>
`;
@@ -75,9 +75,7 @@ if (wrapper) {
});
// we're done, hide the loading spinner
if (spinner) {
spinner.style.display = "none";
}
if (spinner) spinner.style.display = "none";
// the repo descriptions were added after the first twemoji parsing
twemoji.parse(wrapper, {