Fix lint warnings (#5263)

pull/5280/head
Antony Jones 5 years ago committed by GitHub
parent 1d9e2a13f2
commit 82dc26a31c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

4
package-lock.json generated

@ -144,8 +144,8 @@
}
},
"@sveltejs/eslint-config": {
"version": "github:sveltejs/eslint-config#e8a9b27cd3f7aa66388474412b1a5c11c5a44ade",
"from": "github:sveltejs/eslint-config#v0.0.1",
"version": "github:sveltejs/eslint-config#848ce6464a9ae9c2f3a3095474701dfe9ab851df",
"from": "github:sveltejs/eslint-config#v5.0.0",
"dev": true
},
"@tootallnate/once": {

@ -63,7 +63,7 @@
"@rollup/plugin-sucrase": "^3.0.0",
"@rollup/plugin-typescript": "^2.0.1",
"@rollup/plugin-virtual": "^2.0.0",
"@sveltejs/eslint-config": "github:sveltejs/eslint-config#v0.0.1",
"@sveltejs/eslint-config": "github:sveltejs/eslint-config#v5.0.0",
"@types/mocha": "^5.2.7",
"@types/node": "^8.10.53",
"@typescript-eslint/eslint-plugin": "^3.0.2",

@ -8,7 +8,7 @@ import {
create_scopes,
extract_names,
Scope,
extract_identifiers,
extract_identifiers
} from './utils/scope';
import Stylesheet from './css/Stylesheet';
import { test } from '../config';
@ -155,7 +155,7 @@ export default class Component {
) || { 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. <svelte:options tag="my-thing"/>. To hide this warning, use <svelte:options tag={null}/>`,
message: `No custom element 'tag' option was specified. To automatically register a custom element, specify a name with a hyphen in it, e.g. <svelte:options tag="my-thing"/>. To hide this warning, use <svelte:options tag={null}/>`
});
}
this.tag = this.component_options.tag || compile_options.tag;
@ -190,7 +190,7 @@ export default class Component {
this.add_var({
name,
injected: true,
referenced: true,
referenced: true
});
} else if (name[0] === '$') {
this.add_var({
@ -198,7 +198,7 @@ export default class Component {
injected: true,
referenced: true,
mutated: true,
writable: true,
writable: true
});
const subscribable_name = name.slice(1);
@ -289,7 +289,7 @@ export default class Component {
}
const imported_helpers = Array.from(this.helpers, ([name, alias]) => ({
name,
alias,
alias
}));
create_module(
@ -305,7 +305,7 @@ export default class Component {
.filter(variable => variable.module && variable.export_name)
.map(variable => ({
name: variable.name,
as: variable.export_name,
as: variable.export_name
}))
);
@ -342,9 +342,9 @@ export default class Component {
reassigned: v.reassigned || false,
referenced: v.referenced || false,
writable: v.writable || false,
referenced_from_script: v.referenced_from_script || false,
referenced_from_script: v.referenced_from_script || false
})),
stats: this.stats.render(),
stats: this.stats.render()
};
}
@ -409,7 +409,7 @@ export default class Component {
source: this.source,
start: pos.start,
end: pos.end,
filename: this.compile_options.filename,
filename: this.compile_options.filename
});
}
@ -441,7 +441,7 @@ export default class Component {
pos: pos.start,
filename: this.compile_options.filename,
toString: () =>
`${warning.message} (${start.line}:${start.column})\n${frame}`,
`${warning.message} (${start.line}:${start.column})\n${frame}`
});
}
@ -453,7 +453,7 @@ export default class Component {
if (node.type === 'ExportDefaultDeclaration') {
this.error(node, {
code: `default-export`,
message: `A component cannot have a default export`,
message: `A component cannot have a default export`
});
}
@ -461,7 +461,7 @@ export default class Component {
if (node.source) {
this.error(node, {
code: `not-implemented`,
message: `A component currently cannot have an export ... from`,
message: `A component currently cannot have an export ... from`
});
}
if (node.declaration) {
@ -531,10 +531,10 @@ export default class Component {
if (node.type === 'LabeledStatement' && node.label.name === '$') {
component.warn(node as any, {
code: 'module-script-reactive-declaration',
message: '$: has no effect in a module script',
message: '$: has no effect in a module script'
});
}
},
}
});
const { scope, globals } = create_scopes(script.content);
@ -544,7 +544,7 @@ export default class Component {
if (name[0] === '$') {
this.error(node as any, {
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`
});
}
@ -562,7 +562,7 @@ export default class Component {
if (name[0] === '$') {
this.error(node as any, {
code: 'illegal-subscription',
message: `Cannot reference store value inside <script context="module">`,
message: `Cannot reference store value inside <script context="module">`
});
} else {
this.add_var({
@ -623,7 +623,7 @@ export default class Component {
if (name[0] === '$') {
this.error(node as any, {
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`
});
}
@ -647,12 +647,12 @@ export default class Component {
injected: true,
writable: true,
reassigned: true,
initialised: true,
initialised: true
});
} else if (is_reserved_keyword(name)) {
this.add_var({
name,
injected: true,
injected: true
});
} else if (name[0] === '$') {
if (name === '$' || name[1] === '$') {
@ -666,7 +666,7 @@ export default class Component {
name,
injected: true,
mutated: true,
writable: true,
writable: true
});
this.add_reference(name.slice(1));
@ -764,7 +764,7 @@ export default class Component {
if (map.has(node)) {
scope = scope.parent;
}
},
}
});
for (const [parent, prop, index] of to_remove) {
@ -832,7 +832,7 @@ export default class Component {
if (map.has(node)) {
scope = scope.parent;
}
},
}
});
}
@ -844,7 +844,7 @@ export default class Component {
) {
this.warn(node as any, {
code: 'non-top-level-reactive-declaration',
message: '$: has no effect outside of the top-level',
message: '$: has no effect outside of the top-level'
});
}
@ -881,7 +881,7 @@ export default class Component {
if (node.body.type !== 'BlockStatement') {
node.body = {
type: 'BlockStatement',
body: [node.body],
body: [node.body]
};
}
node.body.body.push(inside[0]);
@ -890,8 +890,8 @@ export default class Component {
type: 'BlockStatement',
body: [
before[0],
node,
],
node
]
};
}
return null;
@ -927,7 +927,7 @@ export default class Component {
// TODO is this still true post-#3539?
component.error(declarator as any, {
code: 'destructured-prop',
message: `Cannot declare props in destructured declaration`,
message: `Cannot declare props in destructured declaration`
});
}
@ -990,7 +990,7 @@ export default class Component {
if (node.type === 'ExportNamedDeclaration' && node.declaration) {
(parent as Program).body[index] = node.declaration;
}
},
}
});
}
@ -1004,7 +1004,7 @@ export default class Component {
hoistable_nodes,
var_lookup,
injected_reactive_declaration_vars,
imports,
imports
} = this;
const top_level_function_declarations = new Map();
@ -1136,7 +1136,7 @@ export default class Component {
if (map.has(node)) {
scope = scope.parent;
}
},
}
});
checked.add(fn_declaration);
@ -1229,7 +1229,7 @@ export default class Component {
if (map.has(node)) {
scope = scope.parent;
}
},
}
});
const { expression } = node.body as ExpressionStatement;
@ -1239,7 +1239,7 @@ export default class Component {
assignees,
dependencies,
node,
declaration,
declaration
});
}
});
@ -1320,7 +1320,7 @@ export default class Component {
this.warn(node, {
code: 'missing-declaration',
message,
message
});
}
@ -1343,7 +1343,7 @@ function process_component_options(component: Component, nodes) {
'accessors' in component.compile_options
? component.compile_options.accessors
: !!component.compile_options.customElement,
preserveWhitespace: !!component.compile_options.preserveWhitespace,
preserveWhitespace: !!component.compile_options.preserveWhitespace
};
const node = nodes.find(node => node.name === 'svelte:options');
@ -1384,7 +1384,7 @@ function process_component_options(component: Component, nodes) {
if (tag && !/^[a-zA-Z][a-zA-Z0-9]*-[a-zA-Z0-9-]+$/.test(tag)) {
component.error(attribute, {
code: `invalid-tag-property`,
message: `tag name must be two or more words joined by the '-' character`,
message: `tag name must be two or more words joined by the '-' character`
});
}
@ -1412,12 +1412,12 @@ function process_component_options(component: Component, nodes) {
if (match) {
component.error(attribute, {
code: `invalid-namespace-property`,
message: `Invalid namespace '${ns}' (did you mean '${match}'?)`,
message: `Invalid namespace '${ns}' (did you mean '${match}'?)`
});
} else {
component.error(attribute, {
code: `invalid-namespace-property`,
message: `Invalid namespace '${ns}'`,
message: `Invalid namespace '${ns}'`
});
}
}
@ -1443,13 +1443,13 @@ function process_component_options(component: Component, nodes) {
default:
component.error(attribute, {
code: `invalid-options-attribute`,
message: `<svelte:options> unknown attribute`,
message: `<svelte:options> unknown attribute`
});
}
} else {
component.error(attribute, {
code: `invalid-options-attribute`,
message: `<svelte:options> can only have static 'tag', 'namespace', 'accessors', 'immutable' and 'preserveWhitespace' attributes`,
message: `<svelte:options> can only have static 'tag', 'namespace', 'accessors', 'immutable' and 'preserveWhitespace' attributes`
});
}
});

@ -52,7 +52,7 @@ function validate_options(options: CompileOptions, warnings: Warning[]) {
code: `options-lowercase-name`,
message,
filename,
toString: () => message,
toString: () => message
});
}
@ -62,7 +62,7 @@ function validate_options(options: CompileOptions, warnings: Warning[]) {
code: `options-loop-guard-timeout`,
message,
filename,
toString: () => message,
toString: () => message
});
}
}

@ -76,7 +76,7 @@ export default class Binding extends Node {
if (info.expression.type === 'Identifier' && !variable.writable) component.error(this.expression.node, {
code: 'invalid-binding',
message: 'Cannot bind to a variable which is not writable',
message: 'Cannot bind to a variable which is not writable'
});
}

@ -399,7 +399,7 @@ export default class Element extends Node {
if (/(^[0-9-.])|[\^$@%&#?!|()[\]{}^*+~;]/.test(name)) {
component.error(attribute, {
code: `illegal-attribute`,
message: `'${name}' is not a valid attribute name`,
message: `'${name}' is not a valid attribute name`
});
}
@ -423,7 +423,7 @@ export default class Element extends Node {
if (!(parent.type === 'InlineComponent' || within_custom_element(parent))) {
component.error(attribute, {
code: `invalid-slotted-content`,
message: `Element with a slot='...' attribute must be a child of a component or a descendant of a custom element`,
message: `Element with a slot='...' attribute must be a child of a component or a descendant of a custom element`
});
}
}

@ -12,7 +12,7 @@ const elements_without_text = new Set([
'dl',
'optgroup',
'select',
'video',
'video'
]);
export default class Text extends Node {

@ -106,7 +106,7 @@ export default class Block {
intro: [],
update: [],
outro: [],
destroy: [],
destroy: []
};
this.has_animation = false;

@ -76,7 +76,7 @@ export default class Renderer {
bindings: new Map(),
dependencies: new Set(),
dependencies: new Set()
});
this.block.has_update_method = true;

@ -307,8 +307,8 @@ const attribute_lookup = {
'optgroup',
'option',
'select',
'textarea',
],
'textarea'
]
},
formnovalidate: { property_name: 'formNoValidate', applies_to: ['button', 'input'] },
hidden: {},
@ -335,9 +335,9 @@ const attribute_lookup = {
'progress',
'param',
'select',
'textarea',
],
},
'textarea'
]
}
};
Object.keys(attribute_lookup).forEach(name => {

@ -302,7 +302,7 @@ function get_binding_group(renderer: Renderer, value: Binding, block: Block) {
},
is_context: contexts.length > 0,
contexts,
index,
index
});
}
@ -355,7 +355,7 @@ function get_event_handler(
uses_context: binding.node.is_contextual || binding.node.expression.uses_context, // TODO this is messy
mutation,
contextual_dependencies,
lhs,
lhs
};
}

@ -132,7 +132,7 @@ const events = [
event_names: ['toggle'],
filter: (node: Element, _name: string) =>
node.name === 'details'
},
}
];
export default class ElementWrapper extends Wrapper {

@ -603,7 +603,7 @@ export default class IfBlockWrapper extends Wrapper {
// as -1
operator: val.operator,
prefix: val.prefix,
argument: val.argument,
argument: val.argument
};
}
}

@ -112,7 +112,7 @@ export default class InlineComponentWrapper extends Wrapper {
if (variable.reassigned || variable.export_name || variable.is_reactive_dependency) {
this.renderer.component.warn(this.node, {
code: 'reactive-component',
message: `<${name}/> will not be reactive if ${name} changes. Use <svelte:component this={${name}}/> if you want this reactivity.`,
message: `<${name}/> will not be reactive if ${name} changes. Use <svelte:component this={${name}}/> if you want this reactivity.`
});
}
}

@ -16,7 +16,7 @@ const associated_events = {
outerHeight: 'resize',
scrollX: 'scroll',
scrollY: 'scroll',
scrollY: 'scroll'
};
const properties = {
@ -29,7 +29,7 @@ const readonly = new Set([
'innerHeight',
'outerWidth',
'outerHeight',
'online',
'online'
]);
export default class WindowWrapper extends Wrapper {

@ -34,13 +34,13 @@ export function get_slot_definition(block: Block, scope: TemplateScope, lets: Le
type: 'Property',
kind: 'init',
key: l.name,
value,
value
});
});
const changes_input = {
type: 'ObjectPattern',
properties,
properties
};
const names: Set<string> = new Set();

@ -4,13 +4,13 @@ export function string_to_member_expression(name: string) {
const parts = name.split(".");
let node: MemberExpression | Identifier = {
type: "Identifier",
name: parts[0],
name: parts[0]
};
for (let i = 1; i < parts.length; i++) {
node = {
type: "MemberExpression",
object: node,
property: { type: "Identifier", name: parts[i] },
property: { type: "Identifier", name: parts[i] }
} as MemberExpression;
}
return node;

@ -16,7 +16,7 @@ const escaped = {
"'": '&#39;',
'&': '&amp;',
'<': '&lt;',
'>': '&gt;',
'>': '&gt;'
};
export function escape_html(html) {

@ -41,7 +41,7 @@ export class Parser {
start: null,
end: null,
type: 'Fragment',
children: [],
children: []
};
this.stack.push(this.html);

@ -57,6 +57,6 @@ export default function read_script(parser: Parser, start: number, attributes: N
start,
end: parser.index,
context: get_context(parser, attributes, start),
content: ast,
content: ast
};
}

@ -14,7 +14,7 @@ export default function read_style(parser: Parser, start: number, attributes: No
try {
ast = parse(styles, {
positions: true,
offset: content_start,
offset: content_start
});
} catch (err) {
if (err.name === 'CssSyntaxError') {

@ -134,9 +134,9 @@ export default function mustache(parser: Parser) {
type: 'IfBlock',
elseif: true,
expression,
children: [],
},
],
children: []
}
]
};
parser.stack.push(block.else.children[0]);
@ -161,7 +161,7 @@ export default function mustache(parser: Parser) {
start: parser.index,
end: null,
type: 'ElseBlock',
children: [],
children: []
};
parser.stack.push(block.else);
@ -260,14 +260,14 @@ export default function mustache(parser: Parser) {
type: 'CatchBlock',
children: [],
skip: true
},
}
} :
{
start,
end: null,
type,
expression,
children: [],
children: []
};
parser.allow_whitespace();
@ -350,7 +350,7 @@ export default function mustache(parser: Parser) {
start,
end: parser.index,
type: 'RawMustacheTag',
expression,
expression
});
} else if (parser.eat('@debug')) {
let identifiers;
@ -394,7 +394,7 @@ export default function mustache(parser: Parser) {
start,
end: parser.index,
type: 'MustacheTag',
expression,
expression
});
}
}

@ -25,16 +25,16 @@ const specials = new Map([
'script',
{
read: read_script,
property: 'js',
},
property: 'js'
}
],
[
'style',
{
read: read_style,
property: 'css',
},
],
property: 'css'
}
]
]);
const SELF = /^svelte:self(?=[\s/>])/;
@ -63,7 +63,7 @@ export default function tag(parser: Parser) {
start,
end: parser.index,
type: 'Comment',
data,
data
});
return;
@ -116,7 +116,7 @@ export default function tag(parser: Parser) {
type,
name,
attributes: [],
children: [],
children: []
};
parser.allow_whitespace();
@ -163,7 +163,7 @@ export default function tag(parser: Parser) {
parser.last_auto_closed_tag = {
tag: parent.name,
reason: name,
depth: parser.stack.length,
depth: parser.stack.length
};
}
@ -437,7 +437,7 @@ function read_attribute(parser: Parser, unique_names: Set<string>) {
end,
type: 'Attribute',
name,
value,
value
};
}
@ -504,7 +504,7 @@ function read_sequence(parser: Parser, done: () => boolean): TemplateNode[] {
start: index,
end: parser.index,
type: 'MustacheTag',
expression,
expression
});
current_chunk = {

@ -19,7 +19,7 @@ export default function text(parser: Parser) {
end: parser.index,
type: 'Text',
raw: data,
data: decode_character_references(data),
data: decode_character_references(data)
};
parser.current().children.push(node);

@ -2030,5 +2030,5 @@ export default {
sc: 8827,
wp: 8472,
wr: 8768,
xi: 958,
xi: 958
};

@ -32,7 +32,7 @@ const windows_1252 = [
339,
157,
382,
376,
376
];
const entity_pattern = new RegExp(
@ -124,7 +124,7 @@ const disallowed_contents = new Map([
'address article aside blockquote div dl fieldset footer form h1 h2 h3 h4 h5 h6 header hgroup hr main menu nav ol p pre section table ul'.split(
' '
)
),
)
],
['rt', new Set(['rt', 'rp'])],
['rp', new Set(['rt', 'rp'])],
@ -135,7 +135,7 @@ const disallowed_contents = new Map([
['tfoot', new Set(['tbody'])],
['tr', new Set(['tr', 'tbody'])],
['td', new Set(['td', 'th', 'tr'])],
['th', new Set(['td', 'th', 'tr'])],
['th', new Set(['td', 'th', 'tr'])]
]);
// can this be a child of the parent element, or does it implicitly

@ -49,7 +49,7 @@ async function replace_async(str: string, re: RegExp, func: (...any) => Promise<
({
offset: args[args.length - 2],
length: args[0].length,
replacement: res,
replacement: res
}) as Replacement
)
);

@ -206,7 +206,7 @@ class FuzzySet {
match_score = matches[match_index];
results.push([
match_score / (vector_normal * items[match_index][0]),
items[match_index][1],
items[match_index][1]
]);
}
@ -218,7 +218,7 @@ class FuzzySet {
for (let i = 0; i < end_index; ++i) {
new_results.push([
_distance(results[i][1], normalized_value),
results[i][1],
results[i][1]
]);
}
results = new_results;

@ -105,7 +105,7 @@ export const reserved = new Set([
'void',
'while',
'with',
'yield',
'yield'
]);
const void_element_names = /^(?:area|base|br|col|command|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)$/;

@ -17,7 +17,7 @@ export const valid_namespaces = [
svg,
xlink,
xml,
xmlns,
xmlns
];
export const namespaces: Record<string, string> = { html, mathml, svg, xlink, xml, xmlns };

@ -52,7 +52,7 @@ const subscriber_queue = [];
*/
export function readable<T>(value: T, start: StartStopNotifier<T>): Readable<T> {
return {
subscribe: writable(value, start).subscribe,
subscribe: writable(value, start).subscribe
};
}
@ -184,7 +184,7 @@ export function derived<T>(stores: Stores, fn: Function, initial_value?: T): Rea
},
() => {
pending |= (1 << i);
}),
})
);
inited = true;

@ -12,7 +12,7 @@ export default {
13: .foocc {color: red;}`,
start: { line: 11, column: 2, character: 206 },
end: { line: 11, column: 8, character: 212 },
pos: 206,
pos: 206
},
{
code: 'css-unused-selector',
@ -26,7 +26,7 @@ export default {
14: .foodd {color: red;}`,
start: { line: 12, column: 2, character: 229 },
end: { line: 12, column: 8, character: 235 },
pos: 229,
pos: 229
},
{
code: 'css-unused-selector',
@ -40,7 +40,7 @@ export default {
16: .bb {color: red;}`,
start: { line: 14, column: 2, character: 275 },
end: { line: 14, column: 8, character: 281 },
pos: 275,
pos: 275
},
{
code: 'css-unused-selector',
@ -54,7 +54,7 @@ export default {
22: .ddbar {color: red;}`,
start: { line: 20, column: 2, character: 401 },
end: { line: 20, column: 8, character: 407 },
pos: 401,
pos: 401
},
{
code: 'css-unused-selector',
@ -68,7 +68,7 @@ export default {
23: .fooaabar {color: red;}`,
start: { line: 21, column: 2, character: 424 },
end: { line: 21, column: 8, character: 430 },
pos: 424,
pos: 424
},
{
code: 'css-unused-selector',
@ -82,7 +82,7 @@ export default {
24: .foobbbar {color: red;}`,
start: { line: 22, column: 2, character: 447 },
end: { line: 22, column: 8, character: 453 },
pos: 447,
pos: 447
},
{
code: 'css-unused-selector',
@ -96,7 +96,7 @@ export default {
25: .fooccbar {color: red;}`,
start: { line: 23, column: 2, character: 470 },
end: { line: 23, column: 11, character: 479 },
pos: 470,
pos: 470
},
{
code: 'css-unused-selector',
@ -110,7 +110,7 @@ export default {
26: .fooddbar {color: red;}`,
start: { line: 24, column: 2, character: 496 },
end: { line: 24, column: 11, character: 505 },
pos: 496,
pos: 496
},
{
code: 'css-unused-selector',
@ -124,7 +124,7 @@ export default {
27: .baz {color: red;}`,
start: { line: 25, column: 2, character: 522 },
end: { line: 25, column: 11, character: 531 },
pos: 522,
pos: 522
},
{
code: 'css-unused-selector',
@ -137,7 +137,7 @@ export default {
29: </style>`,
start: { line: 28, column: 2, character: 595 },
end: { line: 28, column: 9, character: 602 },
pos: 595,
},
],
pos: 595
}
]
};

@ -1,3 +1,3 @@
export default {
warnings: [],
warnings: []
};

@ -5,7 +5,7 @@ export default {
end: {
character: 205,
column: 9,
line: 14,
line: 14
},
frame: `
12: .thing.active {color: blue;}
@ -18,8 +18,8 @@ export default {
start: {
character: 198,
column: 2,
line: 14,
},
},
],
line: 14
}
}
]
};

@ -12,7 +12,7 @@ export default {
17: .unused {color: blue;}`,
start: { line: 15, column: 2, character: 261 },
end: { line: 15, column: 15, character: 274 },
pos: 261,
pos: 261
},
{
code: 'css-unused-selector',
@ -25,7 +25,7 @@ export default {
18: </style>`,
start: { line: 17, column: 2, character: 295 },
end: { line: 17, column: 9, character: 302 },
pos: 295,
},
],
pos: 295
}
]
};

@ -153,6 +153,7 @@ export function normalizeHtml(window, html) {
export function setupHtmlEqual() {
const window = env();
// eslint-disable-next-line no-import-assign
assert.htmlEqual = (actual, expected, message) => {
assert.deepEqual(
normalizeHtml(window, actual),

@ -7,7 +7,7 @@ export default {
return {
nullText,
undefinedText,
undefinedText
};
},
@ -17,5 +17,5 @@ export default {
assert.equal(nullText, snapshot.nullText);
assert.equal(undefinedText, snapshot.undefinedText);
},
}
};

@ -3,7 +3,7 @@ export default {
const h1 = target.querySelector('h1');
return {
h1,
h1
};
},

@ -1,6 +1,6 @@
export default {
options: {
dev: true,
loopGuardTimeout: 100,
},
loopGuardTimeout: 100
}
};

@ -2,7 +2,7 @@ export default {
preprocess: [
{
script: ({ content }) => ({ code: content.replace(/one/g, 'two') }),
style: ({ content }) => ({ code: content.replace(/one/g, 'three') }),
},
],
style: ({ content }) => ({ code: content.replace(/one/g, 'three') })
}
]
};

@ -11,7 +11,7 @@ export default {
<div d="4" e="5" foo="1"></div>
<button></button><button></button><button></button><button></button>
`,
async test({ assert, target, window, }) {
async test({ assert, target, window }) {
const [btn1, btn2, btn3, btn4] = target.querySelectorAll('button');
const clickEvent = new window.MouseEvent('click');

@ -13,7 +13,7 @@ export default {
<button></button><button></button><button></button><button></button>
`,
async test({ assert, target, window, }) {
async test({ assert, target, window }) {
const [btn1, btn2, btn3, btn4] = target.querySelectorAll('button');
const clickEvent = new window.MouseEvent('click');

@ -18,5 +18,5 @@ export default {
input.dispatchEvent(event);
assert.ok(blurred);
},
}
};

@ -1,7 +1,7 @@
export default {
props: {
target: 'World!',
display: true,
display: true
},
html: `
@ -16,5 +16,5 @@ export default {
assert.htmlEqual(target.innerHTML, `
<h1>Hello World!</h1>
`);
},
}
};

@ -7,5 +7,5 @@ export default {
await button.dispatchEvent(click);
await Promise.resolve();
assert.htmlEqual(target.innerHTML, `<button>2</button>`);
},
}
};

@ -1,7 +1,7 @@
const value = [];
export default {
props: {
value,
value
},
async test({ assert, component, target, window }) {
@ -32,7 +32,7 @@ export default {
'15',
'16',
'17',
'18',
'18'
]);
},
}
};

@ -33,5 +33,5 @@ export default {
<input>
<p>HE</p>
`);
},
}
};

@ -3,5 +3,5 @@ export default {
test({ assert, component, target }) {
const textarea = target.querySelector('textarea');
assert.ok(textarea.readOnly === false);
},
}
};

@ -3,5 +3,5 @@ export default {
test({ assert, component, target }) {
const textarea = target.querySelector('textarea');
assert.ok(textarea.readOnly);
},
}
};

@ -1,3 +1,3 @@
export default {
html: '<div data-potato=""></div>',
html: '<div data-potato=""></div>'
};

@ -1,5 +1,5 @@
export default {
html: `
<div><div title='foo'>bar</div></div>
`,
`
};

@ -1,3 +1,3 @@
export default {
html: `<div class="false"></div>`,
html: `<div class="false"></div>`
};

@ -1,7 +1,7 @@
export default {
props: {
testName1: "test1",
testName2: "test2",
testName2: "test2"
},
html: `<div class="test1test2"></div>`,

@ -1,7 +1,7 @@
export default {
props: {
testName1: "test1",
testName2: "test2",
testName2: "test2"
},
html: `<div class="test1test2 svelte-x1o6ra"></div>`,

@ -1,7 +1,7 @@
export default {
props: {
testName1: "test1",
testName2: "test2",
testName2: "test2"
},
html: `<div class="test1test2"></div>`,

@ -1,7 +1,7 @@
export default {
props: {
testName1: "test1",
testName2: "test2",
testName2: "test2"
},
html: `<div class="test1test2 svelte-x1o6ra"></div>`,

@ -1,3 +1,3 @@
export default {
html: `<div></div>`,
html: `<div></div>`
};

@ -2,7 +2,7 @@ export default {
skip_if_ssr: true,
props: {
foo: false,
foo: false
},
test({ assert, component, target }) {
@ -15,5 +15,5 @@ export default {
assert.ok(!inputs[0].checked);
assert.ok(inputs[1].checked);
},
}
};

@ -1,3 +1,3 @@
export default {
html: `<div></div>`,
html: `<div></div>`
};

@ -1,7 +1,7 @@
export default {
props: {
thePromise: new Promise((_) => {}),
count: 0,
count: 0
},
html: `
@ -60,5 +60,5 @@ export default {
</div>
`
);
},
}
};

@ -1,7 +1,7 @@
export default {
props: {
thePromise: new Promise((_) => {}),
count: 0,
count: 0
},
html: `
@ -56,5 +56,5 @@ export default {
</div>
`
);
},
}
};

@ -36,5 +36,5 @@ export default {
<editor contenteditable="true">good<span>bye</span></editor>
<p>hello good<span>bye</span></p>
`);
},
}
};

@ -1,6 +1,6 @@
export default {
props: {
name: '<b>world</b>',
name: '<b>world</b>'
},
html: `
@ -34,5 +34,5 @@ export default {
<editor contenteditable="true">good<span>bye</span></editor>
<p>hello good<span>bye</span></p>
`);
},
}
};

@ -30,5 +30,5 @@ export default {
<editor contenteditable="true">goodbye</editor>
<p>hello goodbye</p>
`);
},
}
};

@ -1,6 +1,6 @@
export default {
props: {
name: 'world',
name: 'world'
},
html: `
@ -28,5 +28,5 @@ export default {
<editor contenteditable="true">goodbye</editor>
<p>hello goodbye</p>
`);
},
}
};

@ -2,7 +2,7 @@ export default {
skip_if_ssr: true,
props: {
indeterminate: true,
indeterminate: true
},
html: `
@ -38,5 +38,5 @@ export default {
<p>checked? true</p>
<p>indeterminate? true</p>
`);
},
}
};

@ -3,13 +3,13 @@ export default {
cats: [
{
name: "cat 0",
checked: false,
checked: false
},
{
name: "cat 1",
checked: false,
},
],
checked: false
}
]
},
html: `
@ -22,7 +22,7 @@ export default {
const newCats = cats.slice();
newCats.push({
name: "cat " + cats.length,
checked: false,
checked: false
});
component.cats = newCats;

@ -77,5 +77,5 @@ export default {
assert.equal(inputs[5].checked, false);
assert.equal(inputs[6].checked, false);
assert.equal(inputs[7].checked, true);
},
}
};

@ -7,13 +7,13 @@ const values = [
const selected_array = [
[values[1]],
[],
[values[2]],
[values[2]]
];
export default {
props: {
values,
selected_array,
selected_array
},
html: `

@ -7,13 +7,13 @@ const values = [
const selected_array = [
[values[1]],
[],
[values[2]],
[values[2]]
];
export default {
props: {
values,
selected_array,
selected_array
},
html: `

@ -27,5 +27,5 @@ export default {
component.value = 1;
assert.equal(component.value, 1);
assert.equal(input.value, "1");
},
}
};

@ -1,6 +1,6 @@
export default {
props: {
count: 42,
count: 42
},
html: `
@ -44,5 +44,5 @@ export default {
<input type='number'>
<p>undefined undefined</p>
`);
},
}
};

@ -29,5 +29,5 @@ export default {
<input type=range min=0 max=20>
<p>20 of 20</p>
`);
},
}
};

@ -1,6 +1,6 @@
export default {
props: {
count: 42,
count: 42
},
html: `
@ -34,5 +34,5 @@ export default {
<input type='range'>
<p>number 44</p>
`);
},
}
};

@ -1,6 +1,6 @@
export default {
props: {
count: 42,
count: 42
},
html: `
@ -34,5 +34,5 @@ export default {
<input type='range'>
<p>number 44</p>
`);
},
}
};

@ -1,7 +1,7 @@
export default {
props: {
foo: 'a',
items: ['x'],
items: ['x']
},
html: `
@ -32,5 +32,5 @@ export default {
<div><input><p>b</p></div>
<div><input><p>y</p></div>
`);
},
}
};

@ -121,5 +121,5 @@ export default {
<p>done:one / done:two / remaining:four</p>
`);
},
}
};

@ -1,6 +1,6 @@
export default {
props: {
items: ['one', 'two', 'three'],
items: ['one', 'two', 'three']
},
html: `
@ -65,5 +65,5 @@ export default {
<input><p>five</p>
</div>
`);
},
}
};

@ -1,8 +1,8 @@
export default {
props: {
component: {
name: 'world',
},
name: 'world'
}
},
html: `
@ -36,5 +36,5 @@ export default {
<h1>Hello goodbye!</h1>
<input>
`);
},
}
};

@ -4,8 +4,8 @@ export default {
obj: {
foo: 'a',
bar: 'b',
baz: 'c',
},
baz: 'c'
}
},
html: `
@ -56,5 +56,5 @@ export default {
<input>
<pre>{"foo":"d","bar":"e","baz":"f"}</pre>
`);
},
}
};

@ -2,8 +2,8 @@ export default {
props: {
prop: 'name',
user: {
name: 'alice',
},
name: 'alice'
}
},
html: `
@ -40,5 +40,5 @@ export default {
<input>
<p>hello carol</p>
`);
},
}
};

@ -5,9 +5,9 @@ export default {
{
foo: 'a',
bar: 'b',
baz: 'c',
},
],
baz: 'c'
}
]
},
html: `
@ -58,5 +58,5 @@ export default {
<input>
<pre>{"foo":"d","bar":"e","baz":"f"}</pre>
`);
},
}
};

@ -3,8 +3,8 @@ export default {
items: [
{ description: 'one' },
{ description: 'two' },
{ description: 'three' },
],
{ description: 'three' }
]
},
html: `
@ -45,5 +45,5 @@ export default {
<div><input><p>four</p></div>
<div><input><p>five</p></div>
`);
},
}
};

@ -1,8 +1,8 @@
export default {
props: {
user: {
name: 'alice',
},
name: 'alice'
}
},
html: `
@ -39,5 +39,5 @@ export default {
<input>
<p>hello carol</p>
`);
},
}
};

@ -26,5 +26,5 @@ export default {
component.x = undefined;
assert.equal(input.value, '');
},
}
};

@ -1,6 +1,6 @@
export default {
props: {
name: 'world',
name: 'world'
},
html: `
@ -33,5 +33,5 @@ export default {
<input>
<p>hello goodbye</p>
`);
},
}
};

@ -24,7 +24,7 @@ export default {
`,
props: {
selected: 'b',
selected: 'b'
},
test({ assert, component, target }) {
@ -33,5 +33,5 @@ export default {
assert.equal(select.value, 'b');
assert.ok(options[1].selected);
},
}
};

@ -45,5 +45,5 @@ export default {
</optgroup>
</select>
`);
},
}
};

@ -24,7 +24,7 @@ export default {
`,
props: {
selected: 'one',
selected: 'one'
},
async test({ assert, component, target, window }) {
@ -53,5 +53,5 @@ export default {
`);
component.selected = 'three';
},
}
};

@ -37,5 +37,5 @@ export default {
assert.deepEqual(names, ['world', 'everybody', 'goodbye']);
unsubscribe();
},
}
};

@ -37,5 +37,5 @@ export default {
assert.deepEqual(names, ['world', 'everybody', 'goodbye']);
unsubscribe();
},
}
};

@ -1,6 +1,6 @@
export default {
props: {
value: 'some text',
value: 'some text'
},
html: `
@ -33,5 +33,5 @@ export default {
<textarea></textarea>
<p>goodbye</p>
`);
},
}
};

@ -5,7 +5,7 @@ function callback(refs) {
export default {
html: ``,
props: {
callback,
callback
},
after_test() {
calls = [];
@ -49,5 +49,5 @@ export default {
assert.equal(calls[6][0].ref, divs[0]);
assert.equal(calls[6][1].ref, divs[1]);
assert.equal(calls[6][2].ref, divs[2]);
},
}
};

@ -1,3 +1,3 @@
export default {
error: `potato is not defined`,
error: `potato is not defined`
};

@ -1,3 +1,3 @@
export default {
error: `A is not defined`,
error: `A is not defined`
};

@ -90,7 +90,7 @@ export default {
assert.deepEqual(component.reads, {
_0: 2,
_1: 2,
_1: 2
});
}
};

@ -1,6 +1,6 @@
export default {
props: {
primary: true,
primary: true
},
html: `<div class="test-class primary" role="button"></div>`,
@ -14,5 +14,5 @@ export default {
<div class="test-class primary" role="button"></div>
`
);
},
}
};

@ -21,5 +21,5 @@ export default {
<input>
<p>blah</p>
`);
},
}
};

@ -57,5 +57,5 @@ export default {
assert.equal(input1.value, "456");
assert.equal(input2.value, "456");
assert.equal(count, 3);
},
}
};

@ -1,6 +1,6 @@
export default {
props: {
value: 1,
value: 1
},
test({ assert, component, target, window }) {
@ -26,5 +26,5 @@ export default {
{ value: 2 },
{ value: 2 }
]);
},
}
};

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save