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:
@@ -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;
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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, {
|
||||
|
||||
Reference in New Issue
Block a user