Skip to content
Merged
Prev Previous commit
Next Next commit
revert whitespace changes
  • Loading branch information
43081j committed Jun 6, 2019
commit 9cc3928b02db7d8850e0718d61fcee134f31e8f9
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"prefer-const": [2, { "destructuring": "all" }],
"arrow-spacing": 2,
"no-inner-declarations": 0,
"@typescript-eslint/indent": [2, "tab", { "SwitchCase": 1 }],
"@typescript-eslint/indent": ["warn", "tab", { "SwitchCase": 1 }],
"@typescript-eslint/camelcase": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/array-type": ["error", "array-simple"],
Expand Down
4 changes: 2 additions & 2 deletions src/compiler/compile/render-dom/Block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,8 @@ export default class Block {
${properties}
};
`.replace(/(#+)(\w*)/g, (_match: string, sigil: string, name: string) => {
return sigil === '#' ? this.alias(name) : sigil.slice(1) + name;
});
return sigil === '#' ? this.alias(name) : sigil.slice(1) + name;
});
}

render_listeners(chunk: string = '') {
Expand Down
4 changes: 2 additions & 2 deletions src/compiler/compile/render-dom/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ export default function dom(
${$$props} => {
${uses_props && component.invalidate('$$props', `$$props = @assign(@assign({}, $$props), $$new_props)`)}
${writable_props.map(prop =>
`if ('${prop.export_name}' in $$props) ${component.invalidate(prop.name, `${prop.name} = $$props.${prop.export_name}`)};`
)}
`if ('${prop.export_name}' in $$props) ${component.invalidate(prop.name, `${prop.name} = $$props.${prop.export_name}`)};`
)}
${component.slots.size > 0 &&
`if ('$$scope' in ${$$props}) ${component.invalidate('$$scope', `$$scope = ${$$props}.$$scope`)};`}
}
Expand Down
4 changes: 2 additions & 2 deletions src/compiler/compile/render-dom/wrappers/EachBlock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,8 @@ export default class EachBlockWrapper extends Wrapper {

block.builders.init.add_block(deindent`
const ${get_key} = ctx => ${
// @ts-ignore todo: probably error
this.node.key.render()};
// @ts-ignore todo: probably error
this.node.key.render()};

for (var #i = 0; #i < ${this.vars.each_block_value}.${length}; #i += 1) {
let child_ctx = ${this.vars.get_each_context}(ctx, ${this.vars.each_block_value}, #i);
Expand Down
8 changes: 4 additions & 4 deletions src/compiler/compile/render-dom/wrappers/IfBlock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ export default class IfBlockWrapper extends Wrapper {
block.builders.init.add_block(deindent`
function ${select_block_type}(ctx) {
${this.branches
.map(({ condition, block }) => `${condition ? `if (${condition}) ` : ''}return ${block.name};`)
.join('\n')}
.map(({ condition, block }) => `${condition ? `if (${condition}) ` : ''}return ${block.name};`)
.join('\n')}
}
`);

Expand Down Expand Up @@ -292,8 +292,8 @@ export default class IfBlockWrapper extends Wrapper {

function ${select_block_type}(ctx) {
${this.branches
.map(({ condition }, i) => `${condition ? `if (${condition}) ` : ''}return ${i};`)
.join('\n')}
.map(({ condition }, i) => `${condition ? `if (${condition}) ` : ''}return ${i};`)
.join('\n')}
${!has_else && `return -1;`}
}
`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ export default class InlineComponentWrapper extends Wrapper {
if (attribute.dependencies.size > 0) {
updates.push(deindent`
if (${[...attribute.dependencies]
.map(dependency => `changed.${dependency}`)
.join(' || ')}) ${name_changes}${quote_prop_if_necessary(attribute.name)} = ${attribute.get_value(block)};
.map(dependency => `changed.${dependency}`)
.join(' || ')}) ${name_changes}${quote_prop_if_necessary(attribute.name)} = ${attribute.get_value(block)};
`);
}
});
Expand Down
16 changes: 8 additions & 8 deletions src/compiler/compile/render-dom/wrappers/Window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,17 +141,17 @@ export default class WindowWrapper extends Wrapper {
if (bindings.scrollX || bindings.scrollY) {
block.builders.update.add_block(deindent`
if (${
[bindings.scrollX, bindings.scrollY].filter(Boolean).map(
b => `changed.${b}`
).join(' || ')
} && !${scrolling}) {
[bindings.scrollX, bindings.scrollY].filter(Boolean).map(
b => `changed.${b}`
).join(' || ')
} && !${scrolling}) {
${scrolling} = true;
clearTimeout(${scrolling_timeout});
window.scrollTo(${
bindings.scrollX ? `ctx.${bindings.scrollX}` : `window.pageXOffset`
}, ${
bindings.scrollY ? `ctx.${bindings.scrollY}` : `window.pageYOffset`
});
bindings.scrollX ? `ctx.${bindings.scrollX}` : `window.pageXOffset`
}, ${
bindings.scrollY ? `ctx.${bindings.scrollY}` : `window.pageYOffset`
});
${scrolling_timeout} = setTimeout(${clear_scrolling}, 100);
}
`);
Expand Down