diff --git a/src/compiler/compile/Component.ts b/src/compiler/compile/Component.ts
index 9f4507f88e..9a34e7127a 100644
--- a/src/compiler/compile/Component.ts
+++ b/src/compiler/compile/Component.ts
@@ -122,7 +122,9 @@ export default class Component {
this.file =
compile_options.filename &&
(typeof process !== 'undefined'
- ? compile_options.filename.replace(process.cwd(), '').replace(/^[/\\]/, '')
+ ? compile_options.filename
+ .replace(process.cwd(), '')
+ .replace(/^[/\\]/, '')
: compile_options.filename);
this.locate = getLocator(this.source, { offsetLine: 1 });
@@ -316,9 +318,7 @@ export default class Component {
});
js.map.sources = [
- compile_options.filename
- ? get_relative_path(compile_options.outputFilename || '', compile_options.filename)
- : null,
+ compile_options.filename ? get_relative_path(compile_options.outputFilename || '', compile_options.filename) : null
];
js.map.sourcesContent = [
@@ -860,8 +860,8 @@ export default class Component {
loop_protect(node, scope: Scope, timeout: number): Node | null {
if (node.type === 'WhileStatement' ||
- node.type === 'ForStatement' ||
- node.type === 'DoWhileStatement') {
+ node.type === 'ForStatement' ||
+ node.type === 'DoWhileStatement') {
const guard = this.get_unique_name('guard', scope);
this.used_names.add(guard.name);
@@ -1162,7 +1162,7 @@ export default class Component {
const unsorted_reactive_declarations = [];
- this.ast.instance.content.body.forEach((node) => {
+ this.ast.instance.content.body.forEach(node => {
if (node.type === 'LabeledStatement' && node.label.name === '$') {
this.reactive_declaration_nodes.add(node);
diff --git a/src/compiler/compile/create_module.ts b/src/compiler/compile/create_module.ts
index 1ea7bb0d9a..077e2392aa 100644
--- a/src/compiler/compile/create_module.ts
+++ b/src/compiler/compile/create_module.ts
@@ -99,7 +99,7 @@ function esm(
type: 'Specifier',
local: { type: 'Identifier', name: x.name },
exported: { type: 'Identifier', name: x.as }
- })),
+ }))
};
program.body = b`
diff --git a/src/compiler/compile/nodes/Element.ts b/src/compiler/compile/nodes/Element.ts
index d094613018..3a6179b64f 100644
--- a/src/compiler/compile/nodes/Element.ts
+++ b/src/compiler/compile/nodes/Element.ts
@@ -260,7 +260,7 @@ export default class Element extends Node {
}
if (this.name === 'figure') {
- const children = this.children.filter((node) => {
+ const children = this.children.filter(node => {
if (node.type === 'Comment') return false;
if (node.type === 'Text') return /\S/.test(node.data);
return true;
@@ -384,10 +384,11 @@ 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`,
});
}
@@ -395,7 +396,7 @@ export default class Element extends Node {
if (!attribute.is_static) {
component.error(attribute, {
code: `invalid-slot-attribute`,
- message: `slot attribute cannot have a dynamic value`,
+ message: `slot attribute cannot have a dynamic value`
});
}
@@ -621,6 +622,7 @@ export default class Element extends Node {
message: `'files' binding can only be used with `
});
}
+
} else if (name === 'open') {
if (this.name !== 'details') {
component.error(binding, {
@@ -661,7 +663,7 @@ export default class Element extends Node {
if (this.name === 'svg' && (name === 'offsetWidth' || name === 'offsetHeight')) {
component.error(binding, {
code: 'invalid-binding',
- message: `'${binding.name}' is not a valid binding on