Skip to content

Commit 8257918

Browse files
committed
fix linting/prettier formatting
1 parent f59bf85 commit 8257918

File tree

5 files changed

+14
-8
lines changed

5 files changed

+14
-8
lines changed

packages/svelte/src/compiler/compile/render_dom/invalidate.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export function invalidate(renderer, scope, node, names, main_execution_context
5050
if (
5151
node.type === 'AssignmentExpression' &&
5252
node.operator === '=' &&
53-
nodes_match(node.left, node.right, ['trailingComments','leadingComments']) &&
53+
nodes_match(node.left, node.right, ['trailingComments', 'leadingComments']) &&
5454
tail.length === 0
5555
) {
5656
return get_invalidated(head, node);

packages/svelte/src/compiler/utils/nodes_match.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export function nodes_match(a, b, ignoreKeys=[]) {
1+
export function nodes_match(a, b, ignore_keys = []) {
22
if (!!a !== !!b) return false;
33
if (Array.isArray(a) !== Array.isArray(b)) return false;
44

@@ -8,8 +8,12 @@ export function nodes_match(a, b, ignoreKeys=[]) {
88
return a.every((child, i) => nodes_match(child, b[i]));
99
}
1010

11-
const a_keys = Object.keys(a).sort().filter(key => !ignoreKeys.includes(key));
12-
const b_keys = Object.keys(b).sort().filter(key => !ignoreKeys.includes(key));
11+
const a_keys = Object.keys(a)
12+
.sort()
13+
.filter((key) => !ignore_keys.includes(key));
14+
const b_keys = Object.keys(b)
15+
.sort()
16+
.filter((key) => !ignore_keys.includes(key));
1317

1418
if (a_keys.length !== b_keys.length) return false;
1519

Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1 2 3
1+
1 2 3
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
1 <!-- HTML_TAG_START -->2<!-- HTML_TAG_END --> 3
1+
&nbsp;1
2+
<!-- HTML_TAG_START -->2<!-- HTML_TAG_END -->
3+
3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
export default {
22
async test({ assert, target, window }) {
3-
const incrementButton = target.querySelector('button');
3+
const increment_button = target.querySelector('button');
44

55
assert.equal(target.querySelector('#render-count').innerHTML, '1');
6-
await incrementButton.dispatchEvent(new window.MouseEvent('click'));
6+
await increment_button.dispatchEvent(new window.MouseEvent('click'));
77
assert.equal(target.querySelector('#render-count').innerHTML, '2');
88
}
99
};

0 commit comments

Comments
 (0)