diff --git a/easing.mjs b/easing.mjs index 759c1046e5a6..4fc625c24f97 100644 --- a/easing.mjs +++ b/easing.mjs @@ -6,39 +6,39 @@ Distributed under MIT License https://github.com/mattdesl/eases/blob/master/LICE export { identity as linear } from './internal'; export function backInOut(t) { - var s = 1.70158 * 1.525; + const s = 1.70158 * 1.525; if ((t *= 2) < 1) return 0.5 * (t * t * ((s + 1) * t - s)); return 0.5 * ((t -= 2) * t * ((s + 1) * t + s) + 2); } export function backIn(t) { - var s = 1.70158; + const s = 1.70158; return t * t * ((s + 1) * t - s); } export function backOut(t) { - var s = 1.70158; + const s = 1.70158; return --t * t * ((s + 1) * t + s) + 1; } export function bounceOut(t) { - var a = 4.0 / 11.0; - var b = 8.0 / 11.0; - var c = 9.0 / 10.0; + const a = 4.0 / 11.0; + const b = 8.0 / 11.0; + const c = 9.0 / 10.0; - var ca = 4356.0 / 361.0; - var cb = 35442.0 / 1805.0; - var cc = 16061.0 / 1805.0; + const ca = 4356.0 / 361.0; + const cb = 35442.0 / 1805.0; + const cc = 16061.0 / 1805.0; - var t2 = t * t; + const t2 = t * t; return t < a ? 7.5625 * t2 : t < b - ? 9.075 * t2 - 9.9 * t + 3.4 - : t < c - ? ca * t2 - cb * t + cc - : 10.8 * t * t - 20.52 * t + 10.72; + ? 9.075 * t2 - 9.9 * t + 3.4 + : t < c + ? ca * t2 - cb * t + cc + : 10.8 * t * t - 20.52 * t + 10.72; } export function bounceInOut(t) { @@ -73,7 +73,7 @@ export function cubicIn(t) { } export function cubicOut(t) { - var f = t - 1.0; + const f = t - 1.0; return f * f * f + 1.0; } @@ -102,8 +102,8 @@ export function expoInOut(t) { return t === 0.0 || t === 1.0 ? t : t < 0.5 - ? +0.5 * Math.pow(2.0, 20.0 * t - 10.0) - : -0.5 * Math.pow(2.0, 10.0 - t * 20.0) + 1.0; + ? +0.5 * Math.pow(2.0, 20.0 * t - 10.0) + : -0.5 * Math.pow(2.0, 10.0 - t * 20.0) + 1.0; } export function expoIn(t) { @@ -161,7 +161,7 @@ export function sineInOut(t) { } export function sineIn(t) { - var v = Math.cos(t * Math.PI * 0.5); + const v = Math.cos(t * Math.PI * 0.5); if (Math.abs(v) < 1e-14) return 1; else return 1 - v; } diff --git a/register.js b/register.js index 2c0069c24167..f5cbeb506393 100644 --- a/register.js +++ b/register.js @@ -2,7 +2,7 @@ const fs = require('fs'); const path = require('path'); const { compile } = require('./compiler.js'); -let extensions = ['.svelte', '.html']; +const extensions = ['.svelte', '.html']; let compileOptions = {}; function capitalise(name) { diff --git a/site/.eslintrc.json b/site/.eslintrc.json index 98a3b0889c5d..df5e719204b1 100644 --- a/site/.eslintrc.json +++ b/site/.eslintrc.json @@ -35,7 +35,7 @@ ], "plugins": ["svelte3"], "parserOptions": { - "ecmaVersion": 8, + "ecmaVersion": 9, "sourceType": "module" }, "settings": { diff --git a/site/rollup.config.js b/site/rollup.config.js index 029cf65bcf56..c713be33c1d8 100644 --- a/site/rollup.config.js +++ b/site/rollup.config.js @@ -53,9 +53,6 @@ export default { module: true }) ], - - // temporary, pending Rollup 1.0 - experimentalCodeSplitting: true }, server: { @@ -81,9 +78,6 @@ export default { require('module').builtinModules || Object.keys(process.binding('natives')) ) ], - - // temporary, pending Rollup 1.0 - experimentalCodeSplitting: true }, serviceworker: { diff --git a/site/src/components/PreloadingIndicator.svelte b/site/src/components/PreloadingIndicator.svelte index 43bcf3ab5a96..8b88029abb45 100644 --- a/site/src/components/PreloadingIndicator.svelte +++ b/site/src/components/PreloadingIndicator.svelte @@ -4,11 +4,7 @@ let p = 0; let visible = false; - const sleep = ms => new Promise(f => setTimeout(f, ms)); - onMount(() => { - let running = true; - function next() { visible = true; p += 0.1; @@ -18,10 +14,6 @@ } setTimeout(next, 250); - - return () => { - running = false; - }; }); diff --git a/site/src/components/Repl/ReplWidget.svelte b/site/src/components/Repl/ReplWidget.svelte index fbdd3622a787..07a58140107a 100644 --- a/site/src/components/Repl/ReplWidget.svelte +++ b/site/src/components/Repl/ReplWidget.svelte @@ -29,7 +29,7 @@ if (gist) { fetch(`repl/${gist}.json`).then(r => r.json()).then(data => { - const { id, description, files } = data; + const { description, files } = data; name = description; diff --git a/site/src/routes/_error.svelte b/site/src/routes/_error.svelte index 0071e3cea7b1..282980a2ad3b 100644 --- a/site/src/routes/_error.svelte +++ b/site/src/routes/_error.svelte @@ -7,7 +7,7 @@ // we don't want to use here, // because we only care about the online state when // the page first loads - let online = typeof navigator !== 'undefined' + const online = typeof navigator !== 'undefined' ? navigator.onLine : true; diff --git a/site/src/routes/docs/_GuideContents.svelte b/site/src/routes/docs/_GuideContents.svelte deleted file mode 100644 index f5407164e482..000000000000 --- a/site/src/routes/docs/_GuideContents.svelte +++ /dev/null @@ -1,140 +0,0 @@ - - - - - diff --git a/site/src/routes/docs/index.svelte b/site/src/routes/docs/index.svelte index d60347994e48..7f6fad92d3cc 100644 --- a/site/src/routes/docs/index.svelte +++ b/site/src/routes/docs/index.svelte @@ -6,7 +6,7 @@ diff --git a/site/src/routes/examples/index.svelte b/site/src/routes/examples/index.svelte index abeebb0696d3..a5c816561b25 100644 --- a/site/src/routes/examples/index.svelte +++ b/site/src/routes/examples/index.svelte @@ -37,7 +37,7 @@ let offset = 1; let repl; let isLoading = false; - let cache = {}; + const cache = {}; $: title = title_by_slug[active_slug] || ''; $: first_slug = sections[0].examples[0].slug; @@ -50,21 +50,21 @@ } else { isLoading = true; fetch(`examples/${active_slug}.json`) - .then(async response => { - if (response.ok) { - const {files} = await response.json(); - return process_example(files); - } - }) - .then(components => { - cache[active_slug] = components; - repl.set({components}); - offset = 1; - isLoading = false; - }) - .catch(function(error) { - isLoading = false; - }); + .then(async response => { + if (response.ok) { + const {files} = await response.json(); + return process_example(files); + } + }) + .then(components => { + cache[active_slug] = components; + repl.set({components}); + offset = 1; + isLoading = false; + }) + .catch(() => { + isLoading = false; + }); } } diff --git a/site/src/routes/index.svelte b/site/src/routes/index.svelte index b076fe3a0d2a..539f522b4e5c 100644 --- a/site/src/routes/index.svelte +++ b/site/src/routes/index.svelte @@ -13,7 +13,7 @@