chore: linter fixes

pull/2478/head
Luke Edwards 6 years ago
parent 999b1f4cdb
commit 5830cf346e

@ -56,7 +56,7 @@ export default function() {
renderer.link = link_renderer; renderer.link = link_renderer;
renderer.hr = (...args) => { renderer.hr = () => {
block_open = true; block_open = true;
return '<div class="side-by-side"><div class="copy">'; return '<div class="side-by-side"><div class="copy">';
@ -92,7 +92,7 @@ export default function() {
lang lang
); );
let html = `<div class='${className}'>${prefix}<pre class='language-${plang}'><code>${highlighted}</code></pre></div>`; const html = `<div class='${className}'>${prefix}<pre class='language-${plang}'><code>${highlighted}</code></pre></div>`;
if (block_open) { if (block_open) {
block_open = false; block_open = false;

@ -1,5 +1,4 @@
import fs from 'fs'; import fs from 'fs';
import path from 'path';
let lookup; let lookup;
const titles = new Map(); const titles = new Map();
@ -48,4 +47,4 @@ export function get_example(slug) {
}); });
return { title, files }; return { title, files };
} }

@ -42,7 +42,7 @@ function get_sections() {
throw new Error(`Error building tutorial ${dir}/${tutorial}: ${err.message}`); throw new Error(`Error building tutorial ${dir}/${tutorial}: ${err.message}`);
} }
}) })
} };
}); });
return sections; return sections;

@ -76,7 +76,7 @@ self.addEventListener('fetch', event => {
const response = await fetch(event.request); const response = await fetch(event.request);
cache.put(event.request, response.clone()); cache.put(event.request, response.clone());
return response; return response;
} catch(err) { } catch (err) {
const response = await cache.match(event.request); const response = await cache.match(event.request);
if (response) return response; if (response) return response;

@ -13,7 +13,7 @@ export function keyEvent(code) {
node.removeEventListener('keydown', handleKeydown); node.removeEventListener('keydown', handleKeydown);
} }
}; };
} };
} }
export const enter = keyEvent(13); export const enter = keyEvent(13);

@ -48,14 +48,14 @@ export const langs = {
export function link_renderer(href,title,text) { export function link_renderer(href,title,text) {
let target_attr = ''; let target_attr = '';
let title_attr = ''; let title_attr = '';
if(href.startsWith("http")) { if (href.startsWith("http")) {
target_attr = ' target="_blank"'; target_attr = ' target="_blank"';
} }
if(title !== null) { if (title !== null) {
title_attr = ` title="${title}"`; title_attr = ` title="${title}"`;
} }
return `<a href="${href}"${target_attr}${title_attr}>${text}</a>`; return `<a href="${href}"${target_attr}${title_attr}>${text}</a>`;
}; }

Loading…
Cancel
Save