From 28d6b34598266d352be999697a4588aae3772a23 Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Thu, 19 Oct 2023 10:06:57 -0700 Subject: [PATCH] chore: fix failing format linting (#9338) --- .../src/compiler/compile/render_dom/invalidate.js | 2 +- packages/svelte/src/compiler/utils/nodes_match.js | 10 +++++++--- sites/svelte.dev/src/app.html | 2 +- sites/svelte.dev/src/routes/(authed)/+layout.server.js | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/packages/svelte/src/compiler/compile/render_dom/invalidate.js b/packages/svelte/src/compiler/compile/render_dom/invalidate.js index a007d1af7dbd..9d5baa05e5a1 100644 --- a/packages/svelte/src/compiler/compile/render_dom/invalidate.js +++ b/packages/svelte/src/compiler/compile/render_dom/invalidate.js @@ -50,7 +50,7 @@ export function invalidate(renderer, scope, node, names, main_execution_context if ( node.type === 'AssignmentExpression' && node.operator === '=' && - nodes_match(node.left, node.right, ['trailingComments','leadingComments']) && + nodes_match(node.left, node.right, ['trailingComments', 'leadingComments']) && tail.length === 0 ) { return get_invalidated(head, node); diff --git a/packages/svelte/src/compiler/utils/nodes_match.js b/packages/svelte/src/compiler/utils/nodes_match.js index 2337416f0eed..cd19f485c55b 100644 --- a/packages/svelte/src/compiler/utils/nodes_match.js +++ b/packages/svelte/src/compiler/utils/nodes_match.js @@ -1,4 +1,4 @@ -export function nodes_match(a, b, ignoreKeys=[]) { +export function nodes_match(a, b, ignoreKeys = []) { if (!!a !== !!b) return false; if (Array.isArray(a) !== Array.isArray(b)) return false; @@ -8,8 +8,12 @@ export function nodes_match(a, b, ignoreKeys=[]) { return a.every((child, i) => nodes_match(child, b[i])); } - const a_keys = Object.keys(a).sort().filter(key => !ignoreKeys.includes(key)); - const b_keys = Object.keys(b).sort().filter(key => !ignoreKeys.includes(key)); + const a_keys = Object.keys(a) + .sort() + .filter((key) => !ignoreKeys.includes(key)); + const b_keys = Object.keys(b) + .sort() + .filter((key) => !ignoreKeys.includes(key)); if (a_keys.length !== b_keys.length) return false; diff --git a/sites/svelte.dev/src/app.html b/sites/svelte.dev/src/app.html index 99ce1df11262..bc2a51cc8256 100644 --- a/sites/svelte.dev/src/app.html +++ b/sites/svelte.dev/src/app.html @@ -1,4 +1,4 @@ - + diff --git a/sites/svelte.dev/src/routes/(authed)/+layout.server.js b/sites/svelte.dev/src/routes/(authed)/+layout.server.js index 98ebf9dff7a3..1646322c0031 100644 --- a/sites/svelte.dev/src/routes/(authed)/+layout.server.js +++ b/sites/svelte.dev/src/routes/(authed)/+layout.server.js @@ -2,7 +2,7 @@ import * as session from '$lib/db/session'; /** @type {import('@sveltejs/adapter-vercel').Config} */ export const config = { - runtime: 'nodejs18.x' // see https://github.com/sveltejs/svelte/pull/9136 + runtime: 'nodejs18.x' // see https://github.com/sveltejs/svelte/pull/9136 }; export async function load({ request }) {