pull/11327/head
Rich Harris 2 years ago
parent f74aa4f0d6
commit ff3b95ebf6

@ -1,12 +1,12 @@
## unclosed_element
## element_unclosed
> `<%name%>` was left open
## unclosed_block
## block_unclosed
> Block was left open
## unexpected_block_close
## block_unexpected_close
> Unexpected block closing tag
@ -26,7 +26,7 @@
> '%word%' is a reserved word in JavaScript and cannot be used here
## missing_whitespace
## expected_whitespace
> Expected whitespace
@ -34,23 +34,19 @@
> Expected identifier or destructure pattern
## invalid_script_context
## script_invalid_context
> If the context attribute is supplied, its value must be "module"
## invalid_elseif
## block_invalid_elseif
> 'elseif' should be 'else if'
## invalid_continuing_block_placement
## block_invalid_continuation_placement
> {:...} block is invalid at this position (did you forget to close the preceeding element or block?)
## invalid_block_missing_parent
> %child% block must be a child of %parent%
## duplicate_block_part
## block_duplicate_clause
> %name% cannot appear more than once within a block
@ -62,37 +58,33 @@
> Expected an identifier
## invalid_debug
## debug_tag_invalid_arguments
> {@debug ...} arguments must be identifiers, not arbitrary expressions
## invalid_const
## const_tag_invalid_expression
> {@const ...} must be an assignment
## invalid_block_placement
## block_invalid_placement
> {#%name% ...} block cannot be %location%
## invalid_tag_placement
## tag_invalid_placement
> {@%name% ...} tag cannot be %location%
## missing_attribute_value
## expected_attribute_value
> Expected attribute value
## unclosed_attribute_value
> Expected closing %delimiter% character
## invalid_directive_value
## directive_invalid_value
> Directive value must be a JavaScript expression enclosed in curly braces
## empty_directive_name
## directive_missing_name
> %type% name cannot be empty
> `%type%` name cannot be empty
## invalid_closing_tag
@ -144,4 +136,4 @@
## invalid_snippet_rest_parameter
> snippets do not support rest parameters; use an array instead
> snippets do not support rest parameters; use an array instead

@ -1,31 +0,0 @@
## invalid_slot_element_attribute
> `<slot>` can only receive attributes and (optionally) let directives
## invalid_slot_attribute
> slot attribute must be a static value
## invalid_slot_name_default
> `default` is a reserved word — it cannot be used as a slot name
## invalid_slot_name
> slot attribute must be a static value
## invalid_slot_placement
> Element with a slot='...' attribute must be a child of a component or a descendant of a custom element
## duplicate_slot_name
> Duplicate slot name '%name%' in <%component%>
## invalid_default_slot_content
> Found default slot content alongside an explicit slot="default"
## conflicting_children_snippet
> Cannot use explicit children snippet at the same time as implicit children content. Remove either the non-whitespace content or the children snippet block

@ -96,10 +96,42 @@
> %thing% is invalid inside <%parent%>
## slot_attribute_invalid
> slot attribute must be a static value
## slot_attribute_invalid_placement
> Element with a slot='...' attribute must be a child of a component or a descendant of a custom element
## slot_element_invalid_attribute
> `<slot>` can only receive attributes and (optionally) let directives
## slot_element_invalid_name
> slot attribute must be a static value
## slot_element_invalid_name_default
> `default` is a reserved word — it cannot be used as a slot name
## slot_attribute_duplicate
> Duplicate slot name '%name%' in <%component%>
## slot_default_duplicate
> Found default slot content alongside an explicit slot="default"
## slot_snippet_conflict
> Cannot use `<slot>` syntax and `{@render ...}` tags in the same component. Migrate towards `{@render ...}` tags completely.
## snippet_conflict
> Cannot use explicit children snippet at the same time as implicit children content. Remove either the non-whitespace content or the children snippet block
## style_directive_invalid_modifier
> `style:` directive can only use the `important` modifier

@ -210,8 +210,8 @@ export function cyclical_reactive_declaration(node, cycle) {
* @param {string} name
* @returns {never}
*/
export function unclosed_element(node, name) {
e(node, "unclosed_element", `\`<${name}>\` was left open`);
export function element_unclosed(node, name) {
e(node, "element_unclosed", `\`<${name}>\` was left open`);
}
/**
@ -219,8 +219,8 @@ export function unclosed_element(node, name) {
* @param {null | number | NodeLike} node
* @returns {never}
*/
export function unclosed_block(node) {
e(node, "unclosed_block", "Block was left open");
export function block_unclosed(node) {
e(node, "block_unclosed", "Block was left open");
}
/**
@ -228,8 +228,8 @@ export function unclosed_block(node) {
* @param {null | number | NodeLike} node
* @returns {never}
*/
export function unexpected_block_close(node) {
e(node, "unexpected_block_close", "Unexpected block closing tag");
export function block_unexpected_close(node) {
e(node, "block_unexpected_close", "Unexpected block closing tag");
}
/**
@ -276,8 +276,8 @@ export function unexpected_reserved_word(node, word) {
* @param {null | number | NodeLike} node
* @returns {never}
*/
export function missing_whitespace(node) {
e(node, "missing_whitespace", "Expected whitespace");
export function expected_whitespace(node) {
e(node, "expected_whitespace", "Expected whitespace");
}
/**
@ -294,8 +294,8 @@ export function expected_pattern(node) {
* @param {null | number | NodeLike} node
* @returns {never}
*/
export function invalid_script_context(node) {
e(node, "invalid_script_context", "If the context attribute is supplied, its value must be \"module\"");
export function script_invalid_context(node) {
e(node, "script_invalid_context", "If the context attribute is supplied, its value must be \"module\"");
}
/**
@ -303,8 +303,8 @@ export function invalid_script_context(node) {
* @param {null | number | NodeLike} node
* @returns {never}
*/
export function invalid_elseif(node) {
e(node, "invalid_elseif", "'elseif' should be 'else if'");
export function block_invalid_elseif(node) {
e(node, "block_invalid_elseif", "'elseif' should be 'else if'");
}
/**
@ -312,19 +312,8 @@ export function invalid_elseif(node) {
* @param {null | number | NodeLike} node
* @returns {never}
*/
export function invalid_continuing_block_placement(node) {
e(node, "invalid_continuing_block_placement", "{:...} block is invalid at this position (did you forget to close the preceeding element or block?)");
}
/**
* %child% block must be a child of %parent%
* @param {null | number | NodeLike} node
* @param {string} child
* @param {string} parent
* @returns {never}
*/
export function invalid_block_missing_parent(node, child, parent) {
e(node, "invalid_block_missing_parent", `${child} block must be a child of ${parent}`);
export function block_invalid_continuation_placement(node) {
e(node, "block_invalid_continuation_placement", "{:...} block is invalid at this position (did you forget to close the preceeding element or block?)");
}
/**
@ -333,8 +322,8 @@ export function invalid_block_missing_parent(node, child, parent) {
* @param {string} name
* @returns {never}
*/
export function duplicate_block_part(node, name) {
e(node, "duplicate_block_part", `${name} cannot appear more than once within a block`);
export function block_duplicate_clause(node, name) {
e(node, "block_duplicate_clause", `${name} cannot appear more than once within a block`);
}
/**
@ -360,8 +349,8 @@ export function expected_identifier(node) {
* @param {null | number | NodeLike} node
* @returns {never}
*/
export function invalid_debug(node) {
e(node, "invalid_debug", "{@debug ...} arguments must be identifiers, not arbitrary expressions");
export function debug_tag_invalid_arguments(node) {
e(node, "debug_tag_invalid_arguments", "{@debug ...} arguments must be identifiers, not arbitrary expressions");
}
/**
@ -369,8 +358,8 @@ export function invalid_debug(node) {
* @param {null | number | NodeLike} node
* @returns {never}
*/
export function invalid_const(node) {
e(node, "invalid_const", "{@const ...} must be an assignment");
export function const_tag_invalid_expression(node) {
e(node, "const_tag_invalid_expression", "{@const ...} must be an assignment");
}
/**
@ -380,8 +369,8 @@ export function invalid_const(node) {
* @param {string} location
* @returns {never}
*/
export function invalid_block_placement(node, name, location) {
e(node, "invalid_block_placement", `{#${name} ...} block cannot be ${location}`);
export function block_invalid_placement(node, name, location) {
e(node, "block_invalid_placement", `{#${name} ...} block cannot be ${location}`);
}
/**
@ -391,8 +380,8 @@ export function invalid_block_placement(node, name, location) {
* @param {string} location
* @returns {never}
*/
export function invalid_tag_placement(node, name, location) {
e(node, "invalid_tag_placement", `{@${name} ...} tag cannot be ${location}`);
export function tag_invalid_placement(node, name, location) {
e(node, "tag_invalid_placement", `{@${name} ...} tag cannot be ${location}`);
}
/**
@ -400,18 +389,8 @@ export function invalid_tag_placement(node, name, location) {
* @param {null | number | NodeLike} node
* @returns {never}
*/
export function missing_attribute_value(node) {
e(node, "missing_attribute_value", "Expected attribute value");
}
/**
* Expected closing %delimiter% character
* @param {null | number | NodeLike} node
* @param {string} delimiter
* @returns {never}
*/
export function unclosed_attribute_value(node, delimiter) {
e(node, "unclosed_attribute_value", `Expected closing ${delimiter} character`);
export function expected_attribute_value(node) {
e(node, "expected_attribute_value", "Expected attribute value");
}
/**
@ -419,18 +398,18 @@ export function unclosed_attribute_value(node, delimiter) {
* @param {null | number | NodeLike} node
* @returns {never}
*/
export function invalid_directive_value(node) {
e(node, "invalid_directive_value", "Directive value must be a JavaScript expression enclosed in curly braces");
export function directive_invalid_value(node) {
e(node, "directive_invalid_value", "Directive value must be a JavaScript expression enclosed in curly braces");
}
/**
* %type% name cannot be empty
* `%type%` name cannot be empty
* @param {null | number | NodeLike} node
* @param {string} type
* @returns {never}
*/
export function empty_directive_name(node, type) {
e(node, "empty_directive_name", `${type} name cannot be empty`);
export function directive_missing_name(node, type) {
e(node, "directive_missing_name", `\`${type}\` name cannot be empty`);
}
/**
@ -777,80 +756,6 @@ export function conflicting_property_name(node) {
e(node, "conflicting_property_name", "Cannot have a property and a component export with the same name");
}
/**
* `<slot>` can only receive attributes and (optionally) let directives
* @param {null | number | NodeLike} node
* @returns {never}
*/
export function invalid_slot_element_attribute(node) {
e(node, "invalid_slot_element_attribute", "`<slot>` can only receive attributes and (optionally) let directives");
}
/**
* slot attribute must be a static value
* @param {null | number | NodeLike} node
* @returns {never}
*/
export function invalid_slot_attribute(node) {
e(node, "invalid_slot_attribute", "slot attribute must be a static value");
}
/**
* `default` is a reserved word it cannot be used as a slot name
* @param {null | number | NodeLike} node
* @returns {never}
*/
export function invalid_slot_name_default(node) {
e(node, "invalid_slot_name_default", "`default` is a reserved word — it cannot be used as a slot name");
}
/**
* slot attribute must be a static value
* @param {null | number | NodeLike} node
* @returns {never}
*/
export function invalid_slot_name(node) {
e(node, "invalid_slot_name", "slot attribute must be a static value");
}
/**
* Element with a slot='...' attribute must be a child of a component or a descendant of a custom element
* @param {null | number | NodeLike} node
* @returns {never}
*/
export function invalid_slot_placement(node) {
e(node, "invalid_slot_placement", "Element with a slot='...' attribute must be a child of a component or a descendant of a custom element");
}
/**
* Duplicate slot name '%name%' in <%component%>
* @param {null | number | NodeLike} node
* @param {string} name
* @param {string} component
* @returns {never}
*/
export function duplicate_slot_name(node, name, component) {
e(node, "duplicate_slot_name", `Duplicate slot name '${name}' in <${component}>`);
}
/**
* Found default slot content alongside an explicit slot="default"
* @param {null | number | NodeLike} node
* @returns {never}
*/
export function invalid_default_slot_content(node) {
e(node, "invalid_default_slot_content", "Found default slot content alongside an explicit slot=\"default\"");
}
/**
* Cannot use explicit children snippet at the same time as implicit children content. Remove either the non-whitespace content or the children snippet block
* @param {null | number | NodeLike} node
* @returns {never}
*/
export function conflicting_children_snippet(node) {
e(node, "conflicting_children_snippet", "Cannot use explicit children snippet at the same time as implicit children content. Remove either the non-whitespace content or the children snippet block");
}
/**
* An element that uses the `animate:` directive must be the only child of a keyed `{#each ...}` block
* @param {null | number | NodeLike} node
@ -1077,6 +982,71 @@ export function node_invalid_placement(node, thing, parent) {
e(node, "node_invalid_placement", `${thing} is invalid inside <${parent}>`);
}
/**
* slot attribute must be a static value
* @param {null | number | NodeLike} node
* @returns {never}
*/
export function slot_attribute_invalid(node) {
e(node, "slot_attribute_invalid", "slot attribute must be a static value");
}
/**
* Element with a slot='...' attribute must be a child of a component or a descendant of a custom element
* @param {null | number | NodeLike} node
* @returns {never}
*/
export function slot_attribute_invalid_placement(node) {
e(node, "slot_attribute_invalid_placement", "Element with a slot='...' attribute must be a child of a component or a descendant of a custom element");
}
/**
* `<slot>` can only receive attributes and (optionally) let directives
* @param {null | number | NodeLike} node
* @returns {never}
*/
export function slot_element_invalid_attribute(node) {
e(node, "slot_element_invalid_attribute", "`<slot>` can only receive attributes and (optionally) let directives");
}
/**
* slot attribute must be a static value
* @param {null | number | NodeLike} node
* @returns {never}
*/
export function slot_element_invalid_name(node) {
e(node, "slot_element_invalid_name", "slot attribute must be a static value");
}
/**
* `default` is a reserved word it cannot be used as a slot name
* @param {null | number | NodeLike} node
* @returns {never}
*/
export function slot_element_invalid_name_default(node) {
e(node, "slot_element_invalid_name_default", "`default` is a reserved word — it cannot be used as a slot name");
}
/**
* Duplicate slot name '%name%' in <%component%>
* @param {null | number | NodeLike} node
* @param {string} name
* @param {string} component
* @returns {never}
*/
export function slot_attribute_duplicate(node, name, component) {
e(node, "slot_attribute_duplicate", `Duplicate slot name '${name}' in <${component}>`);
}
/**
* Found default slot content alongside an explicit slot="default"
* @param {null | number | NodeLike} node
* @returns {never}
*/
export function slot_default_duplicate(node) {
e(node, "slot_default_duplicate", "Found default slot content alongside an explicit slot=\"default\"");
}
/**
* Cannot use `<slot>` syntax and `{@render ...}` tags in the same component. Migrate towards `{@render ...}` tags completely.
* @param {null | number | NodeLike} node
@ -1086,6 +1056,15 @@ export function slot_snippet_conflict(node) {
e(node, "slot_snippet_conflict", "Cannot use `<slot>` syntax and `{@render ...}` tags in the same component. Migrate towards `{@render ...}` tags completely.");
}
/**
* Cannot use explicit children snippet at the same time as implicit children content. Remove either the non-whitespace content or the children snippet block
* @param {null | number | NodeLike} node
* @returns {never}
*/
export function snippet_conflict(node) {
e(node, "snippet_conflict", "Cannot use explicit children snippet at the same time as implicit children content. Remove either the non-whitespace content or the children snippet block");
}
/**
* `style:` directive can only use the `important` modifier
* @param {null | number | NodeLike} node

@ -92,10 +92,10 @@ export class Parser {
if (current.type === 'RegularElement') {
current.end = current.start + 1;
e.unclosed_element(current, current.name);
e.element_unclosed(current, current.name);
} else {
current.end = current.start + 1;
e.unclosed_block(current);
e.block_unclosed(current);
}
}
@ -263,7 +263,7 @@ export class Parser {
require_whitespace() {
if (!regex_whitespace.test(this.template[this.index])) {
e.missing_whitespace(this.index);
e.expected_whitespace(this.index);
}
this.allow_whitespace();

@ -16,13 +16,13 @@ function get_context(attributes) {
if (!context) return 'default';
if (context.value.length !== 1 || context.value[0].type !== 'Text') {
e.invalid_script_context(context.start);
e.script_invalid_context(context.start);
}
const value = context.value[0].data;
if (value !== 'module') {
e.invalid_script_context(context.start);
e.script_invalid_context(context.start);
}
return value;
@ -38,7 +38,7 @@ export function read_script(parser, start, attributes) {
const script_start = parser.index;
const data = parser.read_until(regex_closing_script_tag);
if (parser.index >= parser.template.length) {
e.unclosed_element(parser.template.length, 'script');
e.element_unclosed(parser.template.length, 'script');
}
const source =

@ -436,7 +436,7 @@ function read_static_attribute(parser) {
parser.allow_whitespace();
let raw = parser.match_regex(regex_attribute_value);
if (!raw) {
e.missing_attribute_value(parser.index);
e.expected_attribute_value(parser.index);
}
parser.index += raw.length;
@ -552,7 +552,7 @@ function read_attribute(parser) {
const [directive_name, ...modifiers] = name.slice(colon_index + 1).split('|');
if (directive_name === '') {
e.empty_directive_name(start + colon_index + 1, type);
e.directive_missing_name({ start, end: start + colon_index + 1 }, name);
}
if (type === 'StyleDirective') {
@ -577,7 +577,7 @@ function read_attribute(parser) {
const attribute_contains_text =
/** @type {any[]} */ (value).length > 1 || first_value.type === 'Text';
if (attribute_contains_text) {
e.invalid_directive_value(/** @type {number} */ (first_value.start));
e.directive_invalid_value(/** @type {number} */ (first_value.start));
} else {
expression = first_value.expression;
}
@ -678,14 +678,14 @@ function read_attribute_value(parser) {
const pos = error.position?.[0];
if (pos !== undefined && parser.template.slice(pos - 1, pos + 1) === '/>') {
parser.index = pos;
e.unclosed_attribute_value(pos, quote_mark || '}');
e.expected_token(pos, quote_mark || '}');
}
}
throw error;
}
if (value.length === 0 && !quote_mark) {
e.missing_attribute_value(parser.index);
e.expected_attribute_value(parser.index);
}
if (quote_mark) parser.index += 1;
@ -732,12 +732,12 @@ function read_sequence(parser, done, location) {
const index = parser.index - 1;
parser.eat('#');
const name = parser.read_until(/[^a-z]/);
e.invalid_block_placement(index, name, location);
e.block_invalid_placement(index, name, location);
} else if (parser.match('@')) {
const index = parser.index - 1;
parser.eat('@');
const name = parser.read_until(/[^a-z]/);
e.invalid_tag_placement(index, name, location);
e.tag_invalid_placement(index, name, location);
}
flush(parser.index - 1);

@ -331,7 +331,7 @@ function next(parser) {
if (block.type === 'IfBlock') {
if (!parser.eat('else')) e.expected_token(start, '{:else} or {:else if}');
if (parser.eat('if')) e.invalid_elseif(start);
if (parser.eat('if')) e.block_invalid_elseif(start);
parser.allow_whitespace();
@ -389,7 +389,7 @@ function next(parser) {
if (block.type === 'AwaitBlock') {
if (parser.eat('then')) {
if (block.then) {
e.duplicate_block_part(start, '{:then}');
e.block_duplicate_clause(start, '{:then}');
}
if (!parser.eat('}')) {
@ -408,7 +408,7 @@ function next(parser) {
if (parser.eat('catch')) {
if (block.catch) {
e.duplicate_block_part(start, '{:catch}');
e.block_duplicate_clause(start, '{:catch}');
}
if (!parser.eat('}')) {
@ -428,7 +428,7 @@ function next(parser) {
e.expected_token(start, '{:then ...} or {:catch ...}');
}
e.invalid_continuing_block_placement(start);
e.block_invalid_continuation_placement(start);
}
/** @param {import('../index.js').Parser} parser */
@ -466,11 +466,11 @@ function close(parser) {
case 'RegularElement':
// TODO handle implicitly closed elements
e.unexpected_block_close(start);
e.block_unexpected_close(start);
break;
default:
e.unexpected_block_close(start);
e.block_unexpected_close(start);
}
parser.allow_whitespace();
@ -522,7 +522,7 @@ function special(parser) {
identifiers.forEach(
/** @param {any} node */ (node) => {
if (node.type !== 'Identifier') {
e.invalid_debug(/** @type {number} */ (node.start));
e.debug_tag_invalid_arguments(/** @type {number} */ (node.start));
}
}
);

@ -253,7 +253,7 @@ function validate_slot_attribute(context, attribute) {
if (owner) {
if (!is_text_attribute(attribute)) {
e.invalid_slot_attribute(attribute);
e.slot_attribute_invalid(attribute);
}
if (
@ -262,13 +262,13 @@ function validate_slot_attribute(context, attribute) {
owner.type === 'SvelteSelf'
) {
if (owner !== context.path.at(-2)) {
e.invalid_slot_placement(attribute);
e.slot_attribute_invalid_placement(attribute);
}
const name = attribute.value[0].data;
if (context.state.component_slots.has(name)) {
e.duplicate_slot_name(attribute, name, owner.name);
e.slot_attribute_duplicate(attribute, name, owner.name);
}
context.state.component_slots.add(name);
@ -285,12 +285,12 @@ function validate_slot_attribute(context, attribute) {
}
}
e.invalid_default_slot_content(node);
e.slot_default_duplicate(node);
}
}
}
} else {
e.invalid_slot_placement(attribute);
e.slot_attribute_invalid_placement(attribute);
}
}
@ -593,7 +593,7 @@ const validation = {
);
});
if (is_inside_textarea) {
e.invalid_tag_placement(
e.tag_invalid_placement(
node,
'inside <textarea> or <svelte:element this="textarea">',
'render'
@ -634,7 +634,7 @@ const validation = {
(node) => node.type !== 'SnippetBlock' && (node.type !== 'Text' || node.data.trim())
)
) {
e.conflicting_children_snippet(node);
e.snippet_conflict(node);
}
}
},
@ -677,15 +677,15 @@ const validation = {
if (attribute.type === 'Attribute') {
if (attribute.name === 'name') {
if (!is_text_attribute(attribute)) {
e.invalid_slot_name(attribute);
e.slot_element_invalid_name(attribute);
}
const slot_name = attribute.value[0].data;
if (slot_name === 'default') {
e.invalid_slot_name_default(attribute);
e.slot_element_invalid_name_default(attribute);
}
}
} else if (attribute.type !== 'SpreadAttribute' && attribute.type !== 'LetDirective') {
e.invalid_slot_element_attribute(attribute);
e.slot_element_invalid_attribute(attribute);
}
}
},

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({
error: {
code: 'missing_attribute_value',
code: 'expected_attribute_value',
message: 'Expected attribute value',
position: [12, 12]
}

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({
error: {
code: 'invalid_continuing_block_placement',
code: 'block_invalid_continuation_placement',
message:
'{:...} block is invalid at this position (did you forget to close the preceeding element or block?)',
position: [1, 1]

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({
error: {
code: 'duplicate_slot_name',
code: 'slot_attribute_duplicate',
message: "Duplicate slot name 'foo' in <Nested>"
}
});

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({
error: {
code: 'duplicate_slot_name',
code: 'slot_attribute_duplicate',
message: "Duplicate slot name 'foo' in <Nested>"
}
});

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({
error: {
code: 'invalid_default_slot_content',
code: 'slot_default_duplicate',
message: 'Found default slot content alongside an explicit slot="default"'
}
});

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({
error: {
code: 'duplicate_slot_name',
code: 'slot_attribute_duplicate',
message: "Duplicate slot name 'foo' in <Nested>"
}
});

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({
error: {
code: 'duplicate_slot_name',
code: 'slot_attribute_duplicate',
message: "Duplicate slot name 'foo' in <Nested>"
}
});

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({
error: {
code: 'duplicate_slot_name',
code: 'slot_attribute_duplicate',
message: "Duplicate slot name 'foo' in <Nested>"
}
});

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({
error: {
code: 'invalid_slot_placement',
code: 'slot_attribute_invalid_placement',
message:
"Element with a slot='...' attribute must be a child of a component or a descendant of a custom element"
}

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({
error: {
code: 'invalid_slot_placement',
code: 'slot_attribute_invalid_placement',
message:
"Element with a slot='...' attribute must be a child of a component or a descendant of a custom element"
}

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({
error: {
code: 'invalid_slot_placement',
code: 'slot_attribute_invalid_placement',
message:
"Element with a slot='...' attribute must be a child of a component or a descendant of a custom element"
}

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({
error: {
code: 'invalid_continuing_block_placement',
code: 'block_invalid_continuation_placement',
message:
'{:...} block is invalid at this position (did you forget to close the preceeding element or block?)',
position: [6, 6]

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({
error: {
code: 'invalid_continuing_block_placement',
code: 'block_invalid_continuation_placement',
message:
'{:...} block is invalid at this position (did you forget to close the preceeding element or block?)',
position: [18, 18]

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({
error: {
code: 'invalid_continuing_block_placement',
code: 'block_invalid_continuation_placement',
message:
'{:...} block is invalid at this position (did you forget to close the preceeding element or block?)',
position: [17, 17]

@ -2,8 +2,8 @@ import { test } from '../../test';
export default test({
error: {
code: 'empty_directive_name',
message: 'ClassDirective name cannot be empty',
position: [10, 10]
code: 'directive_missing_name',
message: '`class:` name cannot be empty',
position: [4, 10]
}
});

@ -2,8 +2,8 @@ import { test } from '../../test';
export default test({
error: {
code: 'empty_directive_name',
message: 'UseDirective name cannot be empty',
position: [8, 8]
code: 'directive_missing_name',
message: '`use:` name cannot be empty',
position: [4, 8]
}
});

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({
error: {
code: 'missing_whitespace',
code: 'expected_whitespace',
message: 'Expected whitespace',
position: [6, 6]
}

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({
error: {
code: 'unclosed_element',
code: 'element_unclosed',
message: '`<script>` was left open',
position: [32, 32]
}

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({
error: {
code: 'conflicting_children_snippet',
code: 'snippet_conflict',
message:
'Cannot use explicit children snippet at the same time as implicit children content. Remove either the non-whitespace content or the children snippet block',
position: [320, 353]

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({
error: {
code: 'invalid_continuing_block_placement',
code: 'block_invalid_continuation_placement',
message:
'{:...} block is invalid at this position (did you forget to close the preceeding element or block?)',
position: [21, 21]

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({
error: {
code: 'invalid_continuing_block_placement',
code: 'block_invalid_continuation_placement',
message:
'{:...} block is invalid at this position (did you forget to close the preceeding element or block?)',
position: [1, 1]

@ -2,8 +2,8 @@ import { test } from '../../test';
export default test({
error: {
code: 'unclosed_attribute_value',
message: 'Expected closing } character',
code: 'expected_token',
message: 'Expected token }',
position: [19, 19]
}
});

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({
error: {
code: 'unclosed_block',
code: 'block_unclosed',
message: 'Block was left open',
position: [0, 1]
}

@ -2,7 +2,7 @@ import { test } from '../../test';
export default test({
error: {
code: 'unclosed_element',
code: 'element_unclosed',
message: '`<div>` was left open',
position: [0, 1]
}

@ -1,6 +1,6 @@
[
{
"code": "invalid_slot_name_default",
"code": "slot_element_invalid_name_default",
"message": "`default` is a reserved word — it cannot be used as a slot name",
"start": {
"line": 1,

@ -1,6 +1,6 @@
[
{
"code": "invalid_slot_attribute",
"code": "slot_attribute_invalid",
"message": "slot attribute must be a static value",
"start": {
"line": 6,

@ -1,6 +1,6 @@
[
{
"code": "invalid_slot_name",
"code": "slot_element_invalid_name",
"message": "slot attribute must be a static value",
"start": {
"line": 1,

@ -1,6 +1,6 @@
[
{
"code": "invalid_slot_placement",
"code": "slot_attribute_invalid_placement",
"message": "Element with a slot='...' attribute must be a child of a component or a descendant of a custom element",
"start": {
"line": 10,

@ -1,6 +1,6 @@
[
{
"code": "invalid_slot_placement",
"code": "slot_attribute_invalid_placement",
"message": "Element with a slot='...' attribute must be a child of a component or a descendant of a custom element",
"start": {
"line": 7,

@ -1,6 +1,6 @@
[
{
"code": "invalid_slot_placement",
"code": "slot_attribute_invalid_placement",
"message": "Element with a slot='...' attribute must be a child of a component or a descendant of a custom element",
"start": {
"line": 7,

@ -1,6 +1,6 @@
[
{
"code": "invalid_debug",
"code": "debug_tag_invalid_arguments",
"message": "{@debug ...} arguments must be identifiers, not arbitrary expressions",
"start": {
"line": 2,

@ -1,6 +1,6 @@
[
{
"code": "invalid_directive_value",
"code": "directive_invalid_value",
"message": "Directive value must be a JavaScript expression enclosed in curly braces",
"start": {
"line": 1,

@ -1,6 +1,6 @@
[
{
"code": "invalid_tag_placement",
"code": "tag_invalid_placement",
"message": "{@html ...} tag cannot be in attribute value",
"start": {
"line": 1,

@ -1,6 +1,6 @@
[
{
"code": "invalid_tag_placement",
"code": "tag_invalid_placement",
"message": "{@html ...} tag cannot be inside <textarea>",
"start": {
"line": 2,

@ -1,6 +1,6 @@
[
{
"code": "invalid_block_placement",
"code": "block_invalid_placement",
"message": "{#if ...} block cannot be in attribute value",
"start": {
"line": 1,

@ -1,6 +1,6 @@
[
{
"code": "invalid_block_placement",
"code": "block_invalid_placement",
"message": "{#each ...} block cannot be inside <textarea>",
"start": {
"line": 2,

@ -1,6 +1,6 @@
[
{
"code": "invalid_script_context",
"code": "script_invalid_context",
"message": "If the context attribute is supplied, its value must be \"module\"",
"start": {
"line": 1,

@ -1,6 +1,6 @@
[
{
"code": "invalid_slot_placement",
"code": "slot_attribute_invalid_placement",
"message": "Element with a slot='...' attribute must be a child of a component or a descendant of a custom element",
"start": {
"line": 1,

Loading…
Cancel
Save