From de7d1a889e3e9ca1510ab8d31529c88c376137d0 Mon Sep 17 00:00:00 2001
From: Alexandr Orel <4aorel@mail.ru>
Date: Wed, 14 Aug 2019 23:37:53 +0300
Subject: [PATCH] Eslint autofix errors
---
src/compiler/compile/Component.ts | 44 +++----
src/compiler/compile/css/Selector.ts | 8 +-
src/compiler/compile/css/Stylesheet.ts | 4 +-
src/compiler/compile/index.ts | 4 +-
src/compiler/compile/nodes/Animation.ts | 8 +-
src/compiler/compile/nodes/Attribute.ts | 4 +-
src/compiler/compile/nodes/Binding.ts | 2 +-
src/compiler/compile/nodes/EachBlock.ts | 4 +-
src/compiler/compile/nodes/Element.ts | 114 +++++++++---------
src/compiler/compile/nodes/Head.ts | 4 +-
src/compiler/compile/nodes/InlineComponent.ts | 18 +--
src/compiler/compile/nodes/Let.ts | 2 +-
src/compiler/compile/nodes/Slot.ts | 12 +-
src/compiler/compile/nodes/Title.ts | 6 +-
src/compiler/compile/nodes/Transition.ts | 4 +-
src/compiler/compile/nodes/Window.ts | 6 +-
.../compile/nodes/shared/Expression.ts | 8 +-
src/compiler/compile/render_dom/Block.ts | 30 ++---
src/compiler/compile/render_dom/index.ts | 26 ++--
.../compile/render_dom/wrappers/AwaitBlock.ts | 6 +-
.../compile/render_dom/wrappers/EachBlock.ts | 28 ++---
.../render_dom/wrappers/Element/Attribute.ts | 6 +-
.../render_dom/wrappers/Element/Binding.ts | 10 +-
.../wrappers/Element/StyleAttribute.ts | 4 +-
.../render_dom/wrappers/Element/index.ts | 4 +-
.../compile/render_dom/wrappers/Fragment.ts | 2 +-
.../compile/render_dom/wrappers/IfBlock.ts | 22 ++--
.../wrappers/InlineComponent/index.ts | 6 +-
.../compile/render_dom/wrappers/Slot.ts | 2 +-
.../compile/render_dom/wrappers/Text.ts | 2 +-
.../compile/render_dom/wrappers/Title.ts | 6 +-
.../compile/render_dom/wrappers/Window.ts | 12 +-
.../compile/render_dom/wrappers/shared/Tag.ts | 2 +-
.../render_dom/wrappers/shared/Wrapper.ts | 4 +-
.../compile/render_ssr/handlers/DebugTag.ts | 2 +-
.../compile/render_ssr/handlers/EachBlock.ts | 6 +-
.../compile/render_ssr/handlers/Element.ts | 2 +-
.../render_ssr/handlers/InlineComponent.ts | 4 +-
.../compile/render_ssr/handlers/Slot.ts | 2 +-
.../compile/render_ssr/handlers/Title.ts | 4 +-
src/compiler/compile/render_ssr/index.ts | 4 +-
src/compiler/compile/utils/CodeBuilder.ts | 2 +-
src/compiler/compile/utils/__test__.ts | 12 +-
.../compile/utils/get_name_from_filename.ts | 2 +-
src/compiler/parse/index.ts | 20 +--
src/compiler/parse/read/context.ts | 4 +-
src/compiler/parse/read/script.ts | 10 +-
src/compiler/parse/read/style.ts | 4 +-
src/compiler/parse/state/mustache.ts | 18 +--
src/compiler/parse/state/tag.ts | 44 +++----
src/compiler/preprocess/index.ts | 2 +-
src/runtime/internal/Component.ts | 4 +-
src/runtime/internal/lifecycle.ts | 2 +-
src/runtime/internal/ssr.ts | 6 +-
src/runtime/internal/style_manager.ts | 2 +-
src/runtime/internal/transitions.ts | 2 +-
src/runtime/transition/index.ts | 2 +-
test/css/samples/empty-class/_config.js | 6 +-
.../_config.js | 2 +-
.../unused-selector-leading/_config.js | 12 +-
.../unused-selector-ternary/_config.js | 6 +-
test/css/samples/unused-selector/_config.js | 6 +-
.../samples/nested.skip/test.js | 4 +-
.../samples/no-missing-prop-warnings/test.js | 2 +-
.../samples/no-svelte-options/_config.js | 2 +-
.../samples/no-svelte-options/test.js | 2 +-
.../samples/no-tag-warning/_config.js | 2 +-
.../samples/no-tag-warning/test.js | 2 +-
test/custom-elements/samples/no-tag/test.js | 2 +-
.../samples/if-block-update/_config.js | 2 +-
test/hydration/samples/raw/_config.js | 2 +-
test/js/update.js | 10 +-
test/parser/update.js | 10 +-
.../_config.js | 2 +-
test/runtime/samples/action-this/_config.js | 4 +-
.../array-literal-spread-deopt/_config.js | 2 +-
.../attribute-boolean-false/_config.js | 2 +-
.../samples/attribute-boolean-true/_config.js | 2 +-
.../attribute-dynamic-quotemarks/_config.js | 2 +-
.../attribute-dynamic-shorthand/_config.js | 4 +-
.../samples/attribute-dynamic-type/_config.js | 2 +-
.../samples/attribute-dynamic/_config.js | 4 +-
.../samples/attribute-empty/_config.js | 2 +-
.../samples/attribute-false/_config.js | 2 +-
.../_config.js | 4 +-
.../_config.js | 2 +-
.../_config.js | 10 +-
.../_config.js | 10 +-
.../_config.js | 4 +-
.../_config.js | 4 +-
.../_config.js | 10 +-
.../_config.js | 10 +-
.../runtime/samples/attribute-null/_config.js | 2 +-
.../attribute-static-at-symbol/_config.js | 2 +-
.../attribute-static-boolean/_config.js | 2 +-
.../attribute-static-quotemarks/_config.js | 2 +-
.../samples/attribute-static/_config.js | 2 +-
.../samples/attribute-undefined/_config.js | 2 +-
.../samples/await-containing-if/_config.js | 2 +-
.../samples/await-in-removed-if/_config.js | 4 +-
.../samples/await-set-simultaneous/_config.js | 2 +-
.../await-then-catch-no-values/_config.js | 8 +-
.../samples/await-then-shorthand/_config.js | 4 +-
.../_config.js | 6 +-
.../binding-select-in-yield/_config.js | 2 +-
.../_config.js | 2 +-
.../_config.js | 2 +-
test/runtime/samples/class-boolean/_config.js | 2 +-
test/runtime/samples/class-helper/_config.js | 2 +-
.../class-shortcut-with-class/_config.js | 2 +-
.../runtime/samples/class-shortcut/_config.js | 2 +-
.../samples/class-with-attribute/_config.js | 2 +-
.../_config.js | 2 +-
.../class-with-dynamic-attribute/_config.js | 2 +-
.../samples/class-with-spread/_config.js | 2 +-
.../_config.js | 4 +-
.../samples/component-data-empty/_config.js | 2 +-
.../_config.js | 2 +-
.../component-data-static-boolean/_config.js | 2 +-
.../component-shorthand-import/_config.js | 2 +-
.../samples/component-slot-chained/_config.js | 2 +-
.../samples/component-slot-empty-b/_config.js | 2 +-
.../component-slot-let-static/_config.js | 2 +-
.../component-static-at-symbol/_config.js | 2 +-
.../component-yield-multiple-in-if/_config.js | 2 +-
.../component-yield-nested-if/_config.js | 4 +-
.../samples/contextual-callback/_config.js | 2 +-
.../samples/deconflict-builtins/_config.js | 2 +-
.../_config.js | 2 +-
.../_config.js | 2 +-
.../samples/deconflict-non-helpers/_config.js | 2 +-
.../samples/deconflict-self/_config.js | 2 +-
.../samples/deconflict-template-1/_config.js | 2 +-
.../samples/deconflict-template-2/_config.js | 2 +-
.../samples/deconflict-vars/_config.js | 2 +-
test/runtime/samples/destructuring/_config.js | 2 +-
.../dev-warning-destroy-twice/_config.js | 2 +-
.../_config.js | 2 +-
.../_config.js | 2 +-
.../dev-warning-missing-data/_config.js | 4 +-
.../dev-warning-readonly-computed/_config.js | 2 +-
.../_config.js | 2 +-
.../dev-warning-unknown-props/_config.js | 2 +-
.../dynamic-component-nulled-out/_config.js | 2 +-
.../samples/dynamic-component-ref/_config.js | 2 +-
.../each-block-component-no-props/_config.js | 6 +-
.../_config.js | 2 +-
.../samples/each-block-else-in-if/_config.js | 2 +-
.../each-block-else-mount-or-intro/_config.js | 2 +-
.../samples/each-block-empty-outro/_config.js | 2 +-
.../samples/each-block-indexed/_config.js | 2 +-
.../samples/each-block-keyed-empty/_config.js | 2 +-
.../samples/each-block-keyed-html/_config.js | 2 +-
.../_config.js | 2 +-
.../samples/each-block-static/_config.js | 4 +-
.../samples/each-blocks-expression/_config.js | 2 +-
.../samples/each-blocks-nested-b/_config.js | 2 +-
.../samples/each-blocks-nested/_config.js | 2 +-
.../fragment-trailing-whitespace/_config.js | 4 +-
.../samples/function-in-expression/_config.js | 2 +-
.../samples/get-after-destroy/_config.js | 2 +-
.../if-block-elseif-no-else/_config.js | 2 +-
.../samples/immutable-option/_config.js | 4 +-
.../immutable-svelte-meta-false/_config.js | 4 +-
.../samples/immutable-svelte-meta/_config.js | 4 +-
.../imported-renamed-components/_config.js | 2 +-
.../_config.js | 4 +-
.../_config.js | 2 +-
.../runtime/samples/module-context/_config.js | 2 +-
.../samples/names-deconflicted/_config.js | 4 +-
test/runtime/samples/nbsp/_config.js | 2 +-
.../nested-transition-detach-each/_config.js | 4 +-
.../observable-auto-subscribe/_config.js | 2 +-
.../_config.js | 2 +-
.../onmount-fires-when-ready/_config.js | 4 +-
.../samples/option-without-select/_config.js | 2 +-
test/runtime/samples/prop-quoted/_config.js | 4 +-
.../prop-without-semicolon-b/_config.js | 2 +-
.../samples/prop-without-semicolon/_config.js | 2 +-
.../samples/raw-anchor-first-child/_config.js | 4 +-
.../raw-anchor-first-last-child/_config.js | 4 +-
.../samples/raw-anchor-last-child/_config.js | 4 +-
.../_config.js | 4 +-
.../raw-anchor-next-sibling/_config.js | 4 +-
.../raw-anchor-previous-sibling/_config.js | 4 +-
.../raw-mustache-before-element/_config.js | 2 +-
.../raw-mustaches-preserved/_config.js | 4 +-
test/runtime/samples/raw-mustaches/_config.js | 6 +-
.../samples/reactive-value-coerce/_config.js | 4 +-
.../samples/reactive-value-mutate/_config.js | 2 +-
.../samples/set-undefined-attr/_config.js | 4 +-
.../sigil-component-attribute/_config.js | 2 +-
.../runtime/samples/sigil-static-#/_config.js | 2 +-
.../runtime/samples/sigil-static-@/_config.js | 2 +-
.../_config.js | 4 +-
.../spread-component-dynamic/_config.js | 2 +-
.../_config.js | 4 +-
.../samples/spread-element-boolean/_config.js | 2 +-
.../samples/spread-element-input/_config.js | 2 +-
.../_config.js | 4 +-
.../spread-element-multiple/_config.js | 2 +-
.../runtime/samples/spread-element/_config.js | 6 +-
test/runtime/samples/spring/_config.js | 2 +-
.../samples/store-contextual/_config.js | 2 +-
.../samples/store-dev-mode-error/_config.js | 2 +-
.../store-imported-module-b/_config.js | 2 +-
.../_config.js | 4 +-
.../_config.js | 2 +-
.../samples/store-resubscribe-b/_config.js | 2 +-
.../store-resubscribe-observable/_config.js | 2 +-
.../_config.js | 4 +-
.../_config.js | 4 +-
test/runtime/samples/svg-class/_config.js | 2 +-
test/runtime/samples/svg-xmlns/_config.js | 4 +-
test/runtime/samples/svg/_config.js | 4 +-
.../samples/textarea-children/_config.js | 6 +-
.../runtime/samples/textarea-value/_config.js | 2 +-
.../transition-css-in-out-in/_config.js | 6 +-
.../samples/whitespace-each-block/_config.js | 2 +-
.../samples/whitespace-normal/_config.js | 2 +-
.../samples/window-binding-resize/_config.js | 2 +-
.../samples/window-event-context/_config.js | 6 +-
.../samples/window-event-custom/_config.js | 2 +-
test/runtime/samples/window-event/_config.js | 2 +-
224 files changed, 550 insertions(+), 550 deletions(-)
diff --git a/src/compiler/compile/Component.ts b/src/compiler/compile/Component.ts
index 355ad0c423..f267b7c3a5 100644
--- a/src/compiler/compile/Component.ts
+++ b/src/compiler/compile/Component.ts
@@ -163,7 +163,7 @@ export default class Component {
const svelteOptions = ast.html.children.find(child => child.name === 'svelte:options') || { start: 0, end: 0 };
this.warn(svelteOptions, {
code: 'custom-element-no-tag',
- message: `No custom element 'tag' option was specified. To automatically register a custom element, specify a name with a hyphen in it, e.g. . To hide this warning, use `
+ message: 'No custom element \'tag\' option was specified. To automatically register a custom element, specify a name with a hyphen in it, e.g. . To hide this warning, use '
});
}
this.tag = this.component_options.tag || compile_options.tag;
@@ -256,7 +256,7 @@ export default class Component {
const { compile_options, name } = this;
const { format = 'esm' } = compile_options;
- const banner = `/* ${this.file ? `${this.file} ` : ``}generated by Svelte v${"__VERSION__"} */`;
+ const banner = `/* ${this.file ? `${this.file} ` : ''}generated by Svelte v${'__VERSION__'} */`;
result = result
.replace(/__svelte:self__/g, this.name)
@@ -488,16 +488,16 @@ export default class Component {
content.body.forEach(node => {
if (node.type === 'ExportDefaultDeclaration') {
this.error(node, {
- code: `default-export`,
- message: `A component cannot have a default export`
+ code: 'default-export',
+ message: 'A component cannot have a default export'
});
}
if (node.type === 'ExportNamedDeclaration') {
if (node.source) {
this.error(node, {
- code: `not-implemented`,
- message: `A component currently cannot have an export ... from`
+ code: 'not-implemented',
+ message: 'A component currently cannot have an export ... from'
});
}
if (node.declaration) {
@@ -594,7 +594,7 @@ export default class Component {
if (name[0] === '$') {
this.error(node, {
code: 'illegal-declaration',
- message: `The $ prefix is reserved, and cannot be used for variable and import names`
+ message: 'The $ prefix is reserved, and cannot be used for variable and import names'
});
}
@@ -610,7 +610,7 @@ export default class Component {
if (name[0] === '$') {
this.error(node, {
code: 'illegal-subscription',
- message: `Cannot reference store value inside