diff --git a/src/css/Selector.ts b/src/css/Selector.ts index 658f6dc52d..9153768f2f 100644 --- a/src/css/Selector.ts +++ b/src/css/Selector.ts @@ -102,7 +102,7 @@ export default class Selector { while (i-- > 1) { const selector = block.selectors[i]; if (selector.type === 'PseudoClassSelector' && selector.name === 'global') { - validator.error(`:global(...) must be the first element in a compound selector`, selector.start); + validator.error(`:global(...) must be the first element in a compound selector`, { start: selector.start, end: selector.end }); } } }); @@ -120,7 +120,8 @@ export default class Selector { for (let i = start; i < end; i += 1) { if (this.blocks[i].global) { - validator.error(`:global(...) can be at the start or end of a selector sequence, but not in the middle`, this.blocks[i].selectors[0].start); + const selector = this.blocks[i].selectors[0]; + validator.error(`:global(...) can be at the start or end of a selector sequence, but not in the middle`, { start: selector.start, end: selector.end }); } } } diff --git a/src/utils/CompileError.ts b/src/utils/CompileError.ts index 16dabc3c13..c48edba4ab 100644 --- a/src/utils/CompileError.ts +++ b/src/utils/CompileError.ts @@ -4,24 +4,28 @@ import getCodeFrame from '../utils/getCodeFrame'; export default class CompileError extends Error { frame: string; loc: { line: number; column: number }; + end: { line: number; column: number }; pos: number; filename: string; constructor( message: string, template: string, - index: number, - filename: string + startPos: number, + filename: string, + endPos: number = startPos ) { super(message); - const { line, column } = locate(template, index); + const start = locate(template, startPos); + const end = locate(template, endPos); - this.loc = { line: line + 1, column }; - this.pos = index; + this.loc = { line: start.line + 1, column: start.column }; + this.end = { line: end.line + 1, column: end.column }; + this.pos = startPos; this.filename = filename; - this.frame = getCodeFrame(template, line, column); + this.frame = getCodeFrame(template, start.line, start.column); } public toString = () => { diff --git a/src/validate/html/index.ts b/src/validate/html/index.ts index 36f09853d9..958b58e950 100644 --- a/src/validate/html/index.ts +++ b/src/validate/html/index.ts @@ -103,7 +103,7 @@ export default function validateHtml(validator: Validator, html: Node) { let message = `'refs.${ref}' does not exist`; if (match) message += ` (did you mean 'refs.${match}'?)`; - validator.error(message, callee.start); + validator.error(message, { start: callee.start, end: callee.end }); } }); } diff --git a/src/validate/html/validateElement.ts b/src/validate/html/validateElement.ts index 2ca24cff69..46499b0b80 100644 --- a/src/validate/html/validateElement.ts +++ b/src/validate/html/validateElement.ts @@ -34,12 +34,12 @@ export default function validateElement( const nameAttribute = node.attributes.find((attribute: Node) => attribute.name === 'name'); if (nameAttribute) { if (nameAttribute.value.length !== 1 || nameAttribute.value[0].type !== 'Text') { - validator.error(` name cannot be dynamic`, nameAttribute.start); + validator.error(` name cannot be dynamic`, { start: nameAttribute.start, end: nameAttribute.end }); } const slotName = nameAttribute.value[0].data; if (slotName === 'default') { - validator.error(`default is a reserved word — it cannot be used as a slot name`, nameAttribute.start); + validator.error(`default is a reserved word — it cannot be used as a slot name`, { start: nameAttribute.start, end: nameAttribute.end }); } // TODO should duplicate slots be disallowed? Feels like it's more likely to be a @@ -61,9 +61,10 @@ export default function validateElement( if (node.name === 'title') { if (node.attributes.length > 0) { + const attr = node.attributes[0]; validator.error( ` cannot have attributes`, - node.attributes[0].start + { start: attr.start, end: attr.end } ); } @@ -71,7 +72,7 @@ export default function validateElement( if (child.type !== 'Text' && child.type !== 'MustacheTag') { validator.error( `<title> can only contain text and {{tags}}`, - child.start + { start: child.start, end: child.end } ); } }); @@ -98,7 +99,7 @@ export default function validateElement( ) { validator.error( `'value' is not a valid binding on <${node.name}> elements`, - attribute.start + { start: attribute.start, end: attribute.end } ); } @@ -107,21 +108,21 @@ export default function validateElement( if (node.name !== 'input') { validator.error( `'${name}' is not a valid binding on <${node.name}> elements`, - attribute.start + { start: attribute.start, end: attribute.end } ); } if (checkTypeAttribute(validator, node) !== 'checkbox') { validator.error( `'${name}' binding can only be used with <input type="checkbox">`, - attribute.start + { start: attribute.start, end: attribute.end } ); } } else if (name === 'group') { if (node.name !== 'input') { validator.error( `'group' is not a valid binding on <${node.name}> elements`, - attribute.start + { start: attribute.start, end: attribute.end } ); } @@ -130,7 +131,7 @@ export default function validateElement( if (type !== 'checkbox' && type !== 'radio') { validator.error( `'checked' binding can only be used with <input type="checkbox"> or <input type="radio">`, - attribute.start + { start: attribute.start, end: attribute.end } ); } } else if ( @@ -145,13 +146,13 @@ export default function validateElement( if (node.name !== 'audio' && node.name !== 'video') { validator.error( `'${name}' binding can only be used with <audio> or <video>`, - attribute.start + { start: attribute.start, end: attribute.end } ); } } else { validator.error( `'${attribute.name}' is not a valid binding`, - attribute.start + { start: attribute.start, end: attribute.end } ); } } else if (attribute.type === 'EventHandler') { @@ -159,7 +160,7 @@ export default function validateElement( validateEventHandler(validator, attribute, refCallees); } else if (attribute.type === 'Transition') { if (isComponent) { - validator.error(`Transitions can only be applied to DOM elements, not components`, attribute.start); + validator.error(`Transitions can only be applied to DOM elements, not components`, { start: attribute.start, end: attribute.end }); } validator.used.transitions.add(attribute.name); @@ -170,13 +171,13 @@ export default function validateElement( if (bidi) validator.error( `An element can only have one 'transition' directive`, - attribute.start + { start: attribute.start, end: attribute.end } ); validator.error( `An element cannot have both a 'transition' directive and an '${attribute.intro ? 'in' : 'out'}' directive`, - attribute.start + { start: attribute.start, end: attribute.end } ); } @@ -186,11 +187,11 @@ export default function validateElement( `An element cannot have both an '${hasIntro ? 'in' : 'out'}' directive and a 'transition' directive`, - attribute.start + { start: attribute.start, end: attribute.end } ); validator.error( `An element can only have one '${hasIntro ? 'in' : 'out'}' directive`, - attribute.start + { start: attribute.start, end: attribute.end } ); } @@ -201,7 +202,7 @@ export default function validateElement( if (!validator.transitions.has(attribute.name)) { validator.error( `Missing transition '${attribute.name}'`, - attribute.start + { start: attribute.start, end: attribute.end } ); } } else if (attribute.type === 'Attribute') { @@ -209,7 +210,7 @@ export default function validateElement( if (node.children.length) { validator.error( `A <textarea> can have either a value attribute or (equivalently) child content, but not both`, - attribute.start + { start: attribute.start, end: attribute.end } ); } } @@ -228,13 +229,13 @@ function checkTypeAttribute(validator: Validator, node: Node) { if (!attribute) return null; if (attribute.value === true) { - validator.error(`'type' attribute must be specified`, attribute.start); + validator.error(`'type' attribute must be specified`, { start: attribute.start, end: attribute.end }); } if (isDynamic(attribute)) { validator.error( `'type' attribute cannot be dynamic if input uses two-way binding`, - attribute.start + { start: attribute.start, end: attribute.end } ); } @@ -245,7 +246,7 @@ function checkSlotAttribute(validator: Validator, node: Node, attribute: Node, s if (isDynamic(attribute)) { validator.error( `slot attribute cannot have a dynamic value`, - attribute.start + { start: attribute.start, end: attribute.end } ); } @@ -260,11 +261,11 @@ function checkSlotAttribute(validator: Validator, node: Node, attribute: Node, s if (parent.type === 'IfBlock' || parent.type === 'EachBlock') { const message = `Cannot place slotted elements inside an ${parent.type === 'IfBlock' ? 'if' : 'each'}-block`; - validator.error(message, attribute.start); + validator.error(message, { start: attribute.start, end: attribute.end }); } } - validator.error(`Element with a slot='...' attribute must be a descendant of a component or custom element`, attribute.start); + validator.error(`Element with a slot='...' attribute must be a descendant of a component or custom element`, { start: attribute.start, end: attribute.end }); } function isDynamic(attribute: Node) { diff --git a/src/validate/html/validateEventHandler.ts b/src/validate/html/validateEventHandler.ts index aa000d2b9c..01cf86a3c2 100644 --- a/src/validate/html/validateEventHandler.ts +++ b/src/validate/html/validateEventHandler.ts @@ -13,10 +13,10 @@ export default function validateEventHandlerCallee( ) { if (!attribute.expression) return; - const { callee, start, type } = attribute.expression; + const { callee, type } = attribute.expression; if (type !== 'CallExpression') { - validator.error(`Expected a call expression`, start); + validator.error(`Expected a call expression`, { start: attribute.expression.start, end: attribute.expression.end }); } const { name } = flattenReference(callee); diff --git a/src/validate/html/validateHead.ts b/src/validate/html/validateHead.ts index bac56474b2..6dfbf563b9 100644 --- a/src/validate/html/validateHead.ts +++ b/src/validate/html/validateHead.ts @@ -4,7 +4,7 @@ import { Node } from '../../interfaces'; export default function validateHead(validator: Validator, node: Node, refs: Map<string, Node[]>, refCallees: Node[]) { if (node.attributes.length) { - validator.error(`<:Head> should not have any attributes or directives`, node.start); + validator.error(`<:Head> should not have any attributes or directives`, { start: node.start, end: node.end }); } // TODO ensure only valid elements are included here diff --git a/src/validate/html/validateWindow.ts b/src/validate/html/validateWindow.ts index 3cfc80f6bc..fe4c5e7c3a 100644 --- a/src/validate/html/validateWindow.ts +++ b/src/validate/html/validateWindow.ts @@ -25,7 +25,7 @@ export default function validateWindow(validator: Validator, node: Node, refs: M `Bindings on <:Window/> must be to top-level properties, e.g. '${parts[ parts.length - 1 ]}' rather than '${parts.join('.')}'`, - attribute.value.start + { start: attribute.value.start, end: attribute.value.end } ); } @@ -41,12 +41,12 @@ export default function validateWindow(validator: Validator, node: Node, refs: M if (match) { validator.error( `${message} (did you mean '${match}'?)`, - attribute.start + { start: attribute.start, end: attribute.end } ); } else { validator.error( `${message} — valid bindings are ${list(validBindings)}`, - attribute.start + { start: attribute.start, end: attribute.end } ); } } diff --git a/src/validate/index.ts b/src/validate/index.ts index 15f1795457..b801c1650b 100644 --- a/src/validate/index.ts +++ b/src/validate/index.ts @@ -10,10 +10,10 @@ class ValidationError extends CompileError { constructor( message: string, template: string, - index: number, - filename: string + pos: { start: number, end: number }, + filename: string, ) { - super(message, template, index, filename); + super(message, template, pos.start, filename, pos.end); this.name = 'ValidationError'; } } @@ -66,7 +66,7 @@ export class Validator { }; } - error(message: string, pos: number) { + error(message: string, pos: { start: number, end: number }) { throw new ValidationError(message, this.source, pos, this.filename); } diff --git a/src/validate/js/index.ts b/src/validate/js/index.ts index be120c5a4a..962520d020 100644 --- a/src/validate/js/index.ts +++ b/src/validate/js/index.ts @@ -13,14 +13,14 @@ export default function validateJs(validator: Validator, js: Node) { js.content.body.forEach((node: Node) => { // check there are no named exports if (node.type === 'ExportNamedDeclaration') { - validator.error(`A component can only have a default export`, node.start); + validator.error(`A component can only have a default export`, { start: node.start, end: node.start }); } if (node.type === 'ExportDefaultDeclaration') { if (node.declaration.type !== 'ObjectExpression') { return validator.error( `Default export must be an object literal`, - node.declaration.start + { start: node.declaration.start, end: node.declaration.end } ); } @@ -35,16 +35,18 @@ export default function validateJs(validator: Validator, js: Node) { // Remove these checks in version 2 if (props.has('oncreate') && props.has('onrender')) { + const onrender = props.get('onrender'); validator.error( 'Cannot have both oncreate and onrender', - props.get('onrender').start + { start: onrender.start, end: onrender.end } ); } if (props.has('ondestroy') && props.has('onteardown')) { + const onteardown = props.get('onteardown'); validator.error( 'Cannot have both ondestroy and onteardown', - props.get('onteardown').start + { start: onteardown.start, end: onteardown.end } ); } @@ -60,17 +62,17 @@ export default function validateJs(validator: Validator, js: Node) { if (match) { validator.error( `Unexpected property '${name}' (did you mean '${match}'?)`, - prop.start + { start: prop.start, end: prop.end } ); } else if (/FunctionExpression/.test(prop.value.type)) { validator.error( `Unexpected property '${name}' (did you mean to include it in 'methods'?)`, - prop.start + { start: prop.start, end: prop.end } ); } else { validator.error( `Unexpected property '${name}'`, - prop.start + { start: prop.start, end: prop.end } ); } } diff --git a/src/validate/js/propValidators/components.ts b/src/validate/js/propValidators/components.ts index 8c775a504f..f71ba4de5a 100644 --- a/src/validate/js/propValidators/components.ts +++ b/src/validate/js/propValidators/components.ts @@ -8,7 +8,7 @@ export default function components(validator: Validator, prop: Node) { if (prop.value.type !== 'ObjectExpression') { validator.error( `The 'components' property must be an object literal`, - prop.start + { start: prop.start, end: prop.end } ); } @@ -21,7 +21,7 @@ export default function components(validator: Validator, prop: Node) { if (name === 'state') { validator.error( `Component constructors cannot be called 'state' due to technical limitations`, - component.start + { start: component.start, end: component.end } ); } diff --git a/src/validate/js/propValidators/computed.ts b/src/validate/js/propValidators/computed.ts index 94a7212881..afb008bbf3 100644 --- a/src/validate/js/propValidators/computed.ts +++ b/src/validate/js/propValidators/computed.ts @@ -17,7 +17,7 @@ export default function computed(validator: Validator, prop: Node) { if (prop.value.type !== 'ObjectExpression') { validator.error( `The 'computed' property must be an object literal`, - prop.start + { start: prop.start, end: prop.end } ); } @@ -31,21 +31,21 @@ export default function computed(validator: Validator, prop: Node) { const suggestion = name.replace(/[^_$a-z0-9]/ig, '_').replace(/^\d/, '_$&'); validator.error( `Computed property name '${name}' is invalid — must be a valid identifier such as ${suggestion}`, - computation.start + { start: computation.start, end: computation.end } ); } if (reservedNames.has(name)) { validator.error( `Computed property name '${name}' is invalid — cannot be a JavaScript reserved word`, - computation.start + { start: computation.start, end: computation.end } ); } if (!isFunctionExpression.has(computation.value.type)) { validator.error( `Computed properties can be function expressions or arrow function expressions`, - computation.value.start + { start: computation.value.start, end: computation.value.end } ); } @@ -55,14 +55,14 @@ export default function computed(validator: Validator, prop: Node) { if (isThisGetCallExpression(node) && !node.callee.property.computed) { validator.error( `Cannot use this.get(...) — values must be passed into the function as arguments`, - node.start + { start: node.start, end: node.end } ); } if (node.type === 'ThisExpression') { validator.error( `Computed properties should be pure functions — they do not have access to the component instance and cannot use 'this'. Did you mean to put this in 'methods'?`, - node.start + { start: node.start, end: node.end } ); } }); @@ -70,7 +70,7 @@ export default function computed(validator: Validator, prop: Node) { if (params.length === 0) { validator.error( `A computed value must depend on at least one property`, - computation.value.start + { start: computation.value.start, end: computation.value.end } ); } @@ -83,7 +83,7 @@ export default function computed(validator: Validator, prop: Node) { if (!valid) { validator.error( `Computed properties cannot use destructuring in function parameters`, - param.start + { start: param.start, end: param.end } ); } }); diff --git a/src/validate/js/propValidators/data.ts b/src/validate/js/propValidators/data.ts index 009e336b66..8fc4d10a03 100644 --- a/src/validate/js/propValidators/data.ts +++ b/src/validate/js/propValidators/data.ts @@ -7,6 +7,6 @@ export default function data(validator: Validator, prop: Node) { while (prop.type === 'ParenthesizedExpression') prop = prop.expression; if (disallowed.has(prop.value.type)) { - validator.error(`'data' must be a function`, prop.value.start); + validator.error(`'data' must be a function`, { start: prop.value.start, end: prop.value.end }); } } diff --git a/src/validate/js/propValidators/events.ts b/src/validate/js/propValidators/events.ts index 0f81fd7f4d..c12c85465e 100644 --- a/src/validate/js/propValidators/events.ts +++ b/src/validate/js/propValidators/events.ts @@ -7,7 +7,7 @@ export default function events(validator: Validator, prop: Node) { if (prop.value.type !== 'ObjectExpression') { validator.error( `The 'events' property must be an object literal`, - prop.start + { start: prop.start, end: prop.end } ); } diff --git a/src/validate/js/propValidators/helpers.ts b/src/validate/js/propValidators/helpers.ts index 2af7850a5e..9060cabc90 100644 --- a/src/validate/js/propValidators/helpers.ts +++ b/src/validate/js/propValidators/helpers.ts @@ -10,7 +10,7 @@ export default function helpers(validator: Validator, prop: Node) { if (prop.value.type !== 'ObjectExpression') { validator.error( `The 'helpers' property must be an object literal`, - prop.start + { start: prop.start, end: prop.end } ); } @@ -26,14 +26,14 @@ export default function helpers(validator: Validator, prop: Node) { if (isThisGetCallExpression(node) && !node.callee.property.computed) { validator.error( `Cannot use this.get(...) — values must be passed into the helper function as arguments`, - node.start + { start: node.start, end: node.end } ); } if (node.type === 'ThisExpression') { validator.error( `Helpers should be pure functions — they do not have access to the component instance and cannot use 'this'. Did you mean to put this in 'methods'?`, - node.start + { start: node.start, end: node.end } ); } else if (node.type === 'Identifier' && node.name === 'arguments') { usesArguments = true; diff --git a/src/validate/js/propValidators/immutable.ts b/src/validate/js/propValidators/immutable.ts index b54521d9e4..a64d3ae61f 100644 --- a/src/validate/js/propValidators/immutable.ts +++ b/src/validate/js/propValidators/immutable.ts @@ -5,7 +5,7 @@ export default function immutable(validator: Validator, prop: Node) { if (prop.value.type !== 'Literal' || typeof prop.value.value !== 'boolean') { validator.error( `'immutable' must be a boolean literal`, - prop.value.start + { start: prop.value.start, end: prop.value.end } ); } } diff --git a/src/validate/js/propValidators/methods.ts b/src/validate/js/propValidators/methods.ts index c5b9bc220f..74398cd616 100644 --- a/src/validate/js/propValidators/methods.ts +++ b/src/validate/js/propValidators/methods.ts @@ -12,7 +12,7 @@ export default function methods(validator: Validator, prop: Node) { if (prop.value.type !== 'ObjectExpression') { validator.error( `The 'methods' property must be an object literal`, - prop.start + { start: prop.start, end: prop.end } ); } @@ -26,7 +26,7 @@ export default function methods(validator: Validator, prop: Node) { if (builtin.has(name)) { validator.error( `Cannot overwrite built-in method '${name}'`, - prop.start + { start: prop.start, end: prop.end } ); } @@ -35,7 +35,7 @@ export default function methods(validator: Validator, prop: Node) { validator.error( `Method '${prop.key .name}' should be a function expression, not an arrow function expression`, - prop.start + { start: prop.start, end: prop.end } ); } } diff --git a/src/validate/js/propValidators/namespace.ts b/src/validate/js/propValidators/namespace.ts index 30e3ead77f..e472eb5c85 100644 --- a/src/validate/js/propValidators/namespace.ts +++ b/src/validate/js/propValidators/namespace.ts @@ -11,7 +11,7 @@ export default function namespace(validator: Validator, prop: Node) { if (prop.value.type !== 'Literal' || typeof ns !== 'string') { validator.error( `The 'namespace' property must be a string literal representing a valid namespace`, - prop.start + { start: prop.start, end: prop.end } ); } @@ -20,10 +20,10 @@ export default function namespace(validator: Validator, prop: Node) { if (match) { validator.error( `Invalid namespace '${ns}' (did you mean '${match}'?)`, - prop.start + { start: prop.start, end: prop.end } ); } else { - validator.error(`Invalid namespace '${ns}'`, prop.start); + validator.error(`Invalid namespace '${ns}'`, { start: prop.start, end: prop.end }); } } } diff --git a/src/validate/js/propValidators/oncreate.ts b/src/validate/js/propValidators/oncreate.ts index 587a8b3679..3599f03b50 100644 --- a/src/validate/js/propValidators/oncreate.ts +++ b/src/validate/js/propValidators/oncreate.ts @@ -7,7 +7,7 @@ export default function oncreate(validator: Validator, prop: Node) { if (usesThisOrArguments(prop.value.body)) { validator.error( `'oncreate' should be a function expression, not an arrow function expression`, - prop.start + { start: prop.start, end: prop.end } ); } } diff --git a/src/validate/js/propValidators/ondestroy.ts b/src/validate/js/propValidators/ondestroy.ts index e12525e73f..2122d61684 100644 --- a/src/validate/js/propValidators/ondestroy.ts +++ b/src/validate/js/propValidators/ondestroy.ts @@ -7,7 +7,7 @@ export default function ondestroy(validator: Validator, prop: Node) { if (usesThisOrArguments(prop.value.body)) { validator.error( `'ondestroy' should be a function expression, not an arrow function expression`, - prop.start + { start: prop.start, end: prop.end } ); } } diff --git a/src/validate/js/propValidators/props.ts b/src/validate/js/propValidators/props.ts index 408e72a7f5..c6c8c34f77 100644 --- a/src/validate/js/propValidators/props.ts +++ b/src/validate/js/propValidators/props.ts @@ -5,7 +5,7 @@ export default function props(validator: Validator, prop: Node) { if (prop.value.type !== 'ArrayExpression') { validator.error( `'props' must be an array expression, if specified`, - prop.value.start + { start: prop.value.start, end: prop.value.end } ); } @@ -13,7 +13,7 @@ export default function props(validator: Validator, prop: Node) { if (element.type !== 'Literal' || typeof element.value !== 'string') { validator.error( `'props' must be an array of string literals`, - element.start + { start: element.start, end: element.end } ); } }); diff --git a/src/validate/js/propValidators/setup.ts b/src/validate/js/propValidators/setup.ts index 7e4c21ce3b..baec800375 100644 --- a/src/validate/js/propValidators/setup.ts +++ b/src/validate/js/propValidators/setup.ts @@ -7,6 +7,6 @@ export default function setup(validator: Validator, prop: Node) { while (prop.type === 'ParenthesizedExpression') prop = prop.expression; if (disallowed.has(prop.value.type)) { - validator.error(`'setup' must be a function`, prop.value.start); + validator.error(`'setup' must be a function`, { start: prop.value.start, end: prop.value.end }); } } diff --git a/src/validate/js/propValidators/tag.ts b/src/validate/js/propValidators/tag.ts index c64381fc54..50c8f10cf5 100644 --- a/src/validate/js/propValidators/tag.ts +++ b/src/validate/js/propValidators/tag.ts @@ -5,7 +5,7 @@ export default function tag(validator: Validator, prop: Node) { if (prop.value.type !== 'Literal' || typeof prop.value.value !== 'string') { validator.error( `'tag' must be a string literal`, - prop.value.start + { start: prop.value.start, end: prop.value.end } ); } @@ -13,7 +13,7 @@ export default function tag(validator: Validator, prop: Node) { if (!/^[a-zA-Z][a-zA-Z0-9]*-[a-zA-Z0-9-]+$/.test(tag)) { validator.error( `tag name must be two or more words joined by the '-' character`, - prop.value.start + { start: prop.value.start, end: prop.value.end } ); } } diff --git a/src/validate/js/propValidators/transitions.ts b/src/validate/js/propValidators/transitions.ts index 1bd8e677bc..cfabe62438 100644 --- a/src/validate/js/propValidators/transitions.ts +++ b/src/validate/js/propValidators/transitions.ts @@ -7,7 +7,7 @@ export default function transitions(validator: Validator, prop: Node) { if (prop.value.type !== 'ObjectExpression') { validator.error( `The 'transitions' property must be an object literal`, - prop.start + { start: prop.start, end: prop.end } ); } diff --git a/src/validate/js/utils/checkForAccessors.ts b/src/validate/js/utils/checkForAccessors.ts index 6c00d3a23a..d53509d95a 100644 --- a/src/validate/js/utils/checkForAccessors.ts +++ b/src/validate/js/utils/checkForAccessors.ts @@ -8,7 +8,7 @@ export default function checkForAccessors( ) { properties.forEach(prop => { if (prop.kind !== 'init') { - validator.error(`${label} cannot use getters and setters`, prop.start); + validator.error(`${label} cannot use getters and setters`, { start: prop.start, end: prop.end }); } }); } diff --git a/src/validate/js/utils/checkForComputedKeys.ts b/src/validate/js/utils/checkForComputedKeys.ts index cf3892d02c..e11c2734b0 100644 --- a/src/validate/js/utils/checkForComputedKeys.ts +++ b/src/validate/js/utils/checkForComputedKeys.ts @@ -7,7 +7,7 @@ export default function checkForComputedKeys( ) { properties.forEach(prop => { if (prop.key.computed) { - validator.error(`Cannot use computed keys`, prop.start); + validator.error(`Cannot use computed keys`, { start: prop.start, end: prop.end }); } }); } diff --git a/src/validate/js/utils/checkForDupes.ts b/src/validate/js/utils/checkForDupes.ts index 0473d7a265..33662c7374 100644 --- a/src/validate/js/utils/checkForDupes.ts +++ b/src/validate/js/utils/checkForDupes.ts @@ -12,7 +12,7 @@ export default function checkForDupes( const name = getName(prop.key); if (seen.has(name)) { - validator.error(`Duplicate property '${name}'`, prop.start); + validator.error(`Duplicate property '${name}'`, { start: prop.start, end: prop.end }); } seen.add(name); diff --git a/test/validator/index.js b/test/validator/index.js index 25f3989cd5..4961e71265 100644 --- a/test/validator/index.js +++ b/test/validator/index.js @@ -56,6 +56,7 @@ describe("validate", () => { assert.equal(error.message, expected.message); assert.deepEqual(error.loc, expected.loc); + assert.deepEqual(error.end, expected.end); assert.equal(error.pos, expected.pos); } }); diff --git a/test/validator/samples/binding-input-checked/errors.json b/test/validator/samples/binding-input-checked/errors.json index 05747dc96c..477181e40c 100644 --- a/test/validator/samples/binding-input-checked/errors.json +++ b/test/validator/samples/binding-input-checked/errors.json @@ -4,5 +4,9 @@ "line": 1, "column": 7 }, + "end": { + "line": 1, + "column": 25 + }, "pos": 7 }] \ No newline at end of file diff --git a/test/validator/samples/binding-input-type-boolean/errors.json b/test/validator/samples/binding-input-type-boolean/errors.json index feed6e0d5d..7a2dbf2461 100644 --- a/test/validator/samples/binding-input-type-boolean/errors.json +++ b/test/validator/samples/binding-input-type-boolean/errors.json @@ -4,5 +4,9 @@ "line": 1, "column": 24 }, + "end": { + "line": 1, + "column": 28 + }, "pos": 24 }] \ No newline at end of file diff --git a/test/validator/samples/binding-input-type-dynamic/errors.json b/test/validator/samples/binding-input-type-dynamic/errors.json index fbc8284ec4..04ea638354 100644 --- a/test/validator/samples/binding-input-type-dynamic/errors.json +++ b/test/validator/samples/binding-input-type-dynamic/errors.json @@ -4,5 +4,9 @@ "line": 1, "column": 24 }, + "end": { + "line": 1, + "column": 44 + }, "pos": 24 }] \ No newline at end of file diff --git a/test/validator/samples/binding-invalid-on-element/errors.json b/test/validator/samples/binding-invalid-on-element/errors.json index b83530c1ac..a0d783389b 100644 --- a/test/validator/samples/binding-invalid-on-element/errors.json +++ b/test/validator/samples/binding-invalid-on-element/errors.json @@ -4,5 +4,9 @@ "loc": { "line": 1, "column": 5 + }, + "end": { + "line": 1, + "column": 15 } }] \ No newline at end of file diff --git a/test/validator/samples/binding-invalid/errors.json b/test/validator/samples/binding-invalid/errors.json index 3de6e4b913..7893961760 100644 --- a/test/validator/samples/binding-invalid/errors.json +++ b/test/validator/samples/binding-invalid/errors.json @@ -4,5 +4,9 @@ "loc": { "line": 1, "column": 5 + }, + "end": { + "line": 1, + "column": 18 } }] \ No newline at end of file diff --git a/test/validator/samples/component-cannot-be-called-state/errors.json b/test/validator/samples/component-cannot-be-called-state/errors.json index 5c6badc8e7..55ffcc4749 100644 --- a/test/validator/samples/component-cannot-be-called-state/errors.json +++ b/test/validator/samples/component-cannot-be-called-state/errors.json @@ -4,5 +4,9 @@ "loc": { "line": 6, "column": 3 + }, + "end": { + "line": 6, + "column": 8 } }] diff --git a/test/validator/samples/component-slot-default-reserved/errors.json b/test/validator/samples/component-slot-default-reserved/errors.json index f951f61a5d..769684407d 100644 --- a/test/validator/samples/component-slot-default-reserved/errors.json +++ b/test/validator/samples/component-slot-default-reserved/errors.json @@ -4,5 +4,9 @@ "line": 1, "column": 6 }, + "end": { + "line": 1, + "column": 20 + }, "pos": 6 }] \ No newline at end of file diff --git a/test/validator/samples/component-slot-dynamic-attribute/errors.json b/test/validator/samples/component-slot-dynamic-attribute/errors.json index 3d88aa3367..038e22ce32 100644 --- a/test/validator/samples/component-slot-dynamic-attribute/errors.json +++ b/test/validator/samples/component-slot-dynamic-attribute/errors.json @@ -4,5 +4,9 @@ "line": 2, "column": 9 }, + "end": { + "line": 2, + "column": 23 + }, "pos": 18 }] \ No newline at end of file diff --git a/test/validator/samples/component-slot-dynamic/errors.json b/test/validator/samples/component-slot-dynamic/errors.json index 38b45bb364..7c3c96c37d 100644 --- a/test/validator/samples/component-slot-dynamic/errors.json +++ b/test/validator/samples/component-slot-dynamic/errors.json @@ -4,5 +4,9 @@ "line": 1, "column": 6 }, + "end": { + "line": 1, + "column": 20 + }, "pos": 6 }] \ No newline at end of file diff --git a/test/validator/samples/component-slot-each-block/errors.json b/test/validator/samples/component-slot-each-block/errors.json index c85d7fee58..71671fe1d7 100644 --- a/test/validator/samples/component-slot-each-block/errors.json +++ b/test/validator/samples/component-slot-each-block/errors.json @@ -4,5 +4,9 @@ "line": 2, "column": 1 }, + "end": { + "line": 2, + "column": 1 + }, "pos": 27 }] \ No newline at end of file diff --git a/test/validator/samples/component-slotted-each-block/errors.json b/test/validator/samples/component-slotted-each-block/errors.json index eca404b1e2..fb9a71d223 100644 --- a/test/validator/samples/component-slotted-each-block/errors.json +++ b/test/validator/samples/component-slotted-each-block/errors.json @@ -4,5 +4,9 @@ "line": 3, "column": 7 }, + "end": { + "line": 3, + "column": 17 + }, "pos": 43 }] \ No newline at end of file diff --git a/test/validator/samples/component-slotted-if-block/errors.json b/test/validator/samples/component-slotted-if-block/errors.json index 7a3a34b9f7..f1dfee1eb1 100644 --- a/test/validator/samples/component-slotted-if-block/errors.json +++ b/test/validator/samples/component-slotted-if-block/errors.json @@ -4,5 +4,9 @@ "line": 3, "column": 7 }, + "end": { + "line": 3, + "column": 17 + }, "pos": 31 }] \ No newline at end of file diff --git a/test/validator/samples/computed-purity-check-no-this/errors.json b/test/validator/samples/computed-purity-check-no-this/errors.json index 1da0787734..f13a9ec5a0 100644 --- a/test/validator/samples/computed-purity-check-no-this/errors.json +++ b/test/validator/samples/computed-purity-check-no-this/errors.json @@ -4,5 +4,9 @@ "loc": { "line": 7, "column": 4 + }, + "end": { + "line": 7, + "column": 8 } }] diff --git a/test/validator/samples/computed-purity-check-this-get/errors.json b/test/validator/samples/computed-purity-check-this-get/errors.json index 428251ed1c..a6f627e61d 100644 --- a/test/validator/samples/computed-purity-check-this-get/errors.json +++ b/test/validator/samples/computed-purity-check-this-get/errors.json @@ -4,5 +4,9 @@ "loc": { "line": 7, "column": 11 + }, + "end": { + "line": 7, + "column": 28 } }] \ No newline at end of file diff --git a/test/validator/samples/css-invalid-global-placement/errors.json b/test/validator/samples/css-invalid-global-placement/errors.json index a2b8994175..e226a45cb7 100644 --- a/test/validator/samples/css-invalid-global-placement/errors.json +++ b/test/validator/samples/css-invalid-global-placement/errors.json @@ -4,5 +4,9 @@ "line": 2, "column": 6 }, + "end": { + "line": 2, + "column": 19 + }, "pos": 14 }] \ No newline at end of file diff --git a/test/validator/samples/css-invalid-global/errors.json b/test/validator/samples/css-invalid-global/errors.json index 71cb1f1261..95e9e05f0d 100644 --- a/test/validator/samples/css-invalid-global/errors.json +++ b/test/validator/samples/css-invalid-global/errors.json @@ -4,5 +4,9 @@ "line": 2, "column": 5 }, + "end": { + "line": 2, + "column": 18 + }, "pos": 13 }] \ No newline at end of file diff --git a/test/validator/samples/each-block-invalid-context-destructured/errors.json b/test/validator/samples/each-block-invalid-context-destructured/errors.json index b14ef63251..42ebc035bd 100644 --- a/test/validator/samples/each-block-invalid-context-destructured/errors.json +++ b/test/validator/samples/each-block-invalid-context-destructured/errors.json @@ -4,5 +4,9 @@ "line": 1, "column": 18 }, + "end": { + "line": 1, + "column": 18 + }, "pos": 18 }] \ No newline at end of file diff --git a/test/validator/samples/each-block-invalid-context/errors.json b/test/validator/samples/each-block-invalid-context/errors.json index eecb97266b..f39ce80b39 100644 --- a/test/validator/samples/each-block-invalid-context/errors.json +++ b/test/validator/samples/each-block-invalid-context/errors.json @@ -4,5 +4,9 @@ "line": 1, "column": 17 }, + "end": { + "line": 1, + "column": 17 + }, "pos": 17 }] \ No newline at end of file diff --git a/test/validator/samples/event-handler-ref-invalid/errors.json b/test/validator/samples/event-handler-ref-invalid/errors.json index 3ec1eb61b6..2cd043f8ee 100644 --- a/test/validator/samples/event-handler-ref-invalid/errors.json +++ b/test/validator/samples/event-handler-ref-invalid/errors.json @@ -4,5 +4,9 @@ "loc": { "line": 2, "column": 18 + }, + "end": { + "line": 2, + "column": 35 } }] \ No newline at end of file diff --git a/test/validator/samples/export-default-duplicated/errors.json b/test/validator/samples/export-default-duplicated/errors.json index 3b8b22ff88..1b5263f27c 100644 --- a/test/validator/samples/export-default-duplicated/errors.json +++ b/test/validator/samples/export-default-duplicated/errors.json @@ -4,5 +4,9 @@ "loc": { "line": 3, "column": 8 + }, + "end": { + "line": 3, + "column": 8 } }] diff --git a/test/validator/samples/export-default-must-be-object/errors.json b/test/validator/samples/export-default-must-be-object/errors.json index e8106bdc12..90b8434ec7 100644 --- a/test/validator/samples/export-default-must-be-object/errors.json +++ b/test/validator/samples/export-default-must-be-object/errors.json @@ -4,5 +4,9 @@ "loc": { "line": 2, "column": 16 + }, + "end": { + "line": 2, + "column": 22 } }] diff --git a/test/validator/samples/helper-purity-check-no-this/errors.json b/test/validator/samples/helper-purity-check-no-this/errors.json index 87c71a4034..484fb8dde7 100644 --- a/test/validator/samples/helper-purity-check-no-this/errors.json +++ b/test/validator/samples/helper-purity-check-no-this/errors.json @@ -4,5 +4,9 @@ "loc": { "line": 7, "column": 4 + }, + "end": { + "line": 7, + "column": 8 } }] \ No newline at end of file diff --git a/test/validator/samples/helper-purity-check-this-get/errors.json b/test/validator/samples/helper-purity-check-this-get/errors.json index 9a13771658..a18645579e 100644 --- a/test/validator/samples/helper-purity-check-this-get/errors.json +++ b/test/validator/samples/helper-purity-check-this-get/errors.json @@ -4,5 +4,9 @@ "loc": { "line": 7, "column": 11 + }, + "end": { + "line": 7, + "column": 28 } }] \ No newline at end of file diff --git a/test/validator/samples/method-arrow-this/errors.json b/test/validator/samples/method-arrow-this/errors.json index b6fa271105..82c82bcc88 100644 --- a/test/validator/samples/method-arrow-this/errors.json +++ b/test/validator/samples/method-arrow-this/errors.json @@ -4,5 +4,9 @@ "loc": { "line": 6, "column": 3 + }, + "end": { + "line": 8, + "column": 4 } }] diff --git a/test/validator/samples/named-export/errors.json b/test/validator/samples/named-export/errors.json index ce27a91863..67375ffc3b 100644 --- a/test/validator/samples/named-export/errors.json +++ b/test/validator/samples/named-export/errors.json @@ -4,5 +4,9 @@ "loc": { "line": 2, "column": 1 + }, + "end": { + "line": 2, + "column": 1 } }] diff --git a/test/validator/samples/namespace-invalid-unguessable/errors.json b/test/validator/samples/namespace-invalid-unguessable/errors.json index 5c5d55ad13..bc4e72ba13 100644 --- a/test/validator/samples/namespace-invalid-unguessable/errors.json +++ b/test/validator/samples/namespace-invalid-unguessable/errors.json @@ -4,5 +4,9 @@ "loc": { "line": 3, "column": 2 + }, + "end": { + "line": 3, + "column": 18 } }] diff --git a/test/validator/samples/namespace-invalid/errors.json b/test/validator/samples/namespace-invalid/errors.json index b7f6d4d898..9bda600826 100644 --- a/test/validator/samples/namespace-invalid/errors.json +++ b/test/validator/samples/namespace-invalid/errors.json @@ -4,5 +4,9 @@ "loc": { "line": 3, "column": 2 + }, + "end": { + "line": 3, + "column": 41 } }] diff --git a/test/validator/samples/namespace-non-literal/errors.json b/test/validator/samples/namespace-non-literal/errors.json index 75e1bd7712..87e6661ca2 100644 --- a/test/validator/samples/namespace-non-literal/errors.json +++ b/test/validator/samples/namespace-non-literal/errors.json @@ -4,5 +4,9 @@ "loc": { "line": 5, "column": 2 + }, + "end": { + "line": 5, + "column": 11 } }] diff --git a/test/validator/samples/non-object-literal-components/errors.json b/test/validator/samples/non-object-literal-components/errors.json index 3133a80e5d..b24462633d 100644 --- a/test/validator/samples/non-object-literal-components/errors.json +++ b/test/validator/samples/non-object-literal-components/errors.json @@ -4,5 +4,9 @@ "line": 3, "column": 2 }, + "end": { + "line": 3, + "column": 37 + }, "pos": 29 }] \ No newline at end of file diff --git a/test/validator/samples/non-object-literal-events/errors.json b/test/validator/samples/non-object-literal-events/errors.json index b0ff728675..9ff486382a 100644 --- a/test/validator/samples/non-object-literal-events/errors.json +++ b/test/validator/samples/non-object-literal-events/errors.json @@ -4,5 +4,9 @@ "line": 3, "column": 2 }, + "end": { + "line": 3, + "column": 33 + }, "pos": 29 }] \ No newline at end of file diff --git a/test/validator/samples/non-object-literal-helpers/errors.json b/test/validator/samples/non-object-literal-helpers/errors.json index 602f89ff96..89448096dd 100644 --- a/test/validator/samples/non-object-literal-helpers/errors.json +++ b/test/validator/samples/non-object-literal-helpers/errors.json @@ -4,5 +4,9 @@ "line": 3, "column": 2 }, + "end": { + "line": 3, + "column": 34 + }, "pos": 29 }] \ No newline at end of file diff --git a/test/validator/samples/non-object-literal-methods/errors.json b/test/validator/samples/non-object-literal-methods/errors.json index 7a7f107f1e..94ae9a54ba 100644 --- a/test/validator/samples/non-object-literal-methods/errors.json +++ b/test/validator/samples/non-object-literal-methods/errors.json @@ -4,5 +4,9 @@ "line": 3, "column": 2 }, + "end": { + "line": 3, + "column": 34 + }, "pos": 29 }] \ No newline at end of file diff --git a/test/validator/samples/non-object-literal-transitions/errors.json b/test/validator/samples/non-object-literal-transitions/errors.json index 640706b4ed..b897a49c58 100644 --- a/test/validator/samples/non-object-literal-transitions/errors.json +++ b/test/validator/samples/non-object-literal-transitions/errors.json @@ -4,5 +4,9 @@ "line": 3, "column": 2 }, + "end": { + "line": 3, + "column": 38 + }, "pos": 29 }] \ No newline at end of file diff --git a/test/validator/samples/oncreate-arrow-this/errors.json b/test/validator/samples/oncreate-arrow-this/errors.json index 06d020a4f8..71efdb4b2c 100644 --- a/test/validator/samples/oncreate-arrow-this/errors.json +++ b/test/validator/samples/oncreate-arrow-this/errors.json @@ -4,5 +4,9 @@ "loc": { "line": 3, "column": 2 + }, + "end": { + "line": 5, + "column": 3 } }] diff --git a/test/validator/samples/ondestroy-arrow-this/errors.json b/test/validator/samples/ondestroy-arrow-this/errors.json index 98e176f58f..c266c0754f 100644 --- a/test/validator/samples/ondestroy-arrow-this/errors.json +++ b/test/validator/samples/ondestroy-arrow-this/errors.json @@ -4,5 +4,9 @@ "loc": { "line": 3, "column": 2 + }, + "end": { + "line": 5, + "column": 3 } }] diff --git a/test/validator/samples/properties-computed-cannot-be-reserved/errors.json b/test/validator/samples/properties-computed-cannot-be-reserved/errors.json index 39c4039743..5ba22a2406 100644 --- a/test/validator/samples/properties-computed-cannot-be-reserved/errors.json +++ b/test/validator/samples/properties-computed-cannot-be-reserved/errors.json @@ -5,5 +5,9 @@ "line": 9, "column": 3 }, + "end": { + "line": 9, + "column": 18 + }, "pos": 87 }] diff --git a/test/validator/samples/properties-computed-must-be-an-object/errors.json b/test/validator/samples/properties-computed-must-be-an-object/errors.json index c8c0392eea..9928b933ff 100644 --- a/test/validator/samples/properties-computed-must-be-an-object/errors.json +++ b/test/validator/samples/properties-computed-must-be-an-object/errors.json @@ -4,5 +4,9 @@ "line": 5, "column": 2 }, + "end": { + "line": 5, + "column": 23 + }, "pos": 42 }] diff --git a/test/validator/samples/properties-computed-must-be-functions/errors.json b/test/validator/samples/properties-computed-must-be-functions/errors.json index 958b07b3f6..91498f6f0c 100644 --- a/test/validator/samples/properties-computed-must-be-functions/errors.json +++ b/test/validator/samples/properties-computed-must-be-functions/errors.json @@ -4,5 +4,9 @@ "line": 6, "column": 8 }, + "end": { + "line": 6, + "column": 20 + }, "pos": 62 }] diff --git a/test/validator/samples/properties-computed-must-be-valid-function-names/errors.json b/test/validator/samples/properties-computed-must-be-valid-function-names/errors.json index ebaac56a8f..b29b60a5a8 100644 --- a/test/validator/samples/properties-computed-must-be-valid-function-names/errors.json +++ b/test/validator/samples/properties-computed-must-be-valid-function-names/errors.json @@ -4,5 +4,9 @@ "line": 9, "column": 3 }, + "end": { + "line": 9, + "column": 28 + }, "pos": 87 }] diff --git a/test/validator/samples/properties-computed-no-destructuring/errors.json b/test/validator/samples/properties-computed-no-destructuring/errors.json index cc209ea249..0426542fcb 100644 --- a/test/validator/samples/properties-computed-no-destructuring/errors.json +++ b/test/validator/samples/properties-computed-no-destructuring/errors.json @@ -4,5 +4,9 @@ "line": 6, "column": 8 }, + "end": { + "line": 6, + "column": 16 + }, "pos": 62 }] diff --git a/test/validator/samples/properties-computed-values-needs-arguments/errors.json b/test/validator/samples/properties-computed-values-needs-arguments/errors.json index 3f4994e790..bc99ad0969 100644 --- a/test/validator/samples/properties-computed-values-needs-arguments/errors.json +++ b/test/validator/samples/properties-computed-values-needs-arguments/errors.json @@ -4,5 +4,9 @@ "loc": { "line": 4, "column": 8 + }, + "end": { + "line": 4, + "column": 16 } }] \ No newline at end of file diff --git a/test/validator/samples/properties-data-must-be-function/errors.json b/test/validator/samples/properties-data-must-be-function/errors.json index d72146f3ff..ac4c70b4d2 100644 --- a/test/validator/samples/properties-data-must-be-function/errors.json +++ b/test/validator/samples/properties-data-must-be-function/errors.json @@ -4,5 +4,9 @@ "line": 5, "column": 8 }, + "end": { + "line": 7, + "column": 3 + }, "pos": 48 }] diff --git a/test/validator/samples/properties-duplicated/errors.json b/test/validator/samples/properties-duplicated/errors.json index a743641a6c..b0fb99dbdb 100644 --- a/test/validator/samples/properties-duplicated/errors.json +++ b/test/validator/samples/properties-duplicated/errors.json @@ -4,5 +4,9 @@ "line": 9, "column": 2 }, + "end": { + "line": 11, + "column": 3 + }, "pos": 74 }] diff --git a/test/validator/samples/properties-methods-getters-setters/errors.json b/test/validator/samples/properties-methods-getters-setters/errors.json index 40481f12e0..baeb863631 100644 --- a/test/validator/samples/properties-methods-getters-setters/errors.json +++ b/test/validator/samples/properties-methods-getters-setters/errors.json @@ -4,5 +4,9 @@ "line": 4, "column": 3 }, + "end": { + "line": 6, + "column": 4 + }, "pos": 43 }] diff --git a/test/validator/samples/properties-unexpected-b/errors.json b/test/validator/samples/properties-unexpected-b/errors.json index bc1a41a69a..ffa07eea39 100644 --- a/test/validator/samples/properties-unexpected-b/errors.json +++ b/test/validator/samples/properties-unexpected-b/errors.json @@ -4,5 +4,9 @@ "line": 5, "column": 2 }, + "end": { + "line": 7, + "column": 3 + }, "pos": 42 }] diff --git a/test/validator/samples/properties-unexpected/errors.json b/test/validator/samples/properties-unexpected/errors.json index e4d4c58f78..a9e17c465e 100644 --- a/test/validator/samples/properties-unexpected/errors.json +++ b/test/validator/samples/properties-unexpected/errors.json @@ -4,5 +4,9 @@ "line": 5, "column": 2 }, + "end": { + "line": 9, + "column": 3 + }, "pos": 42 }] diff --git a/test/validator/samples/slot-attribute-invalid/errors.json b/test/validator/samples/slot-attribute-invalid/errors.json index aea1fa7db1..5243a6ebd9 100644 --- a/test/validator/samples/slot-attribute-invalid/errors.json +++ b/test/validator/samples/slot-attribute-invalid/errors.json @@ -4,5 +4,9 @@ "line": 1, "column": 5 }, + "end": { + "line": 1, + "column": 15 + }, "pos": 5 }] diff --git a/test/validator/samples/tag-invalid/errors.json b/test/validator/samples/tag-invalid/errors.json index 7ce908daee..c57ea66f0b 100644 --- a/test/validator/samples/tag-invalid/errors.json +++ b/test/validator/samples/tag-invalid/errors.json @@ -4,5 +4,9 @@ "line": 3, "column": 7 }, + "end": { + "line": 3, + "column": 16 + }, "pos": 34 }] \ No newline at end of file diff --git a/test/validator/samples/tag-non-string/errors.json b/test/validator/samples/tag-non-string/errors.json index d617b031ff..81a0dc51b3 100644 --- a/test/validator/samples/tag-non-string/errors.json +++ b/test/validator/samples/tag-non-string/errors.json @@ -4,5 +4,9 @@ "line": 3, "column": 7 }, + "end": { + "line": 3, + "column": 9 + }, "pos": 34 }] \ No newline at end of file diff --git a/test/validator/samples/textarea-value-children/errors.json b/test/validator/samples/textarea-value-children/errors.json index 21282fb93b..a35bc57136 100644 --- a/test/validator/samples/textarea-value-children/errors.json +++ b/test/validator/samples/textarea-value-children/errors.json @@ -4,5 +4,9 @@ "line": 1, "column": 10 }, + "end": { + "line": 1, + "column": 25 + }, "pos": 10 }] \ No newline at end of file diff --git a/test/validator/samples/title-no-attributes/errors.json b/test/validator/samples/title-no-attributes/errors.json index 29528a3b49..613a7e2bc6 100644 --- a/test/validator/samples/title-no-attributes/errors.json +++ b/test/validator/samples/title-no-attributes/errors.json @@ -4,5 +4,9 @@ "line": 2, "column": 8 }, + "end": { + "line": 2, + "column": 25 + }, "pos": 16 }] \ No newline at end of file diff --git a/test/validator/samples/title-no-children/errors.json b/test/validator/samples/title-no-children/errors.json index 9eb910ecf8..f62fb4d0ba 100644 --- a/test/validator/samples/title-no-children/errors.json +++ b/test/validator/samples/title-no-children/errors.json @@ -4,5 +4,9 @@ "line": 2, "column": 11 }, + "end": { + "line": 2, + "column": 35 + }, "pos": 19 }] \ No newline at end of file diff --git a/test/validator/samples/transition-duplicate-in-transition/errors.json b/test/validator/samples/transition-duplicate-in-transition/errors.json index c48f56ede9..c9cad28cf7 100644 --- a/test/validator/samples/transition-duplicate-in-transition/errors.json +++ b/test/validator/samples/transition-duplicate-in-transition/errors.json @@ -4,5 +4,9 @@ "line": 1, "column": 12 }, + "end": { + "line": 1, + "column": 26 + }, "pos": 12 }] \ No newline at end of file diff --git a/test/validator/samples/transition-duplicate-in/errors.json b/test/validator/samples/transition-duplicate-in/errors.json index a3cc8b0ec5..184a10ca80 100644 --- a/test/validator/samples/transition-duplicate-in/errors.json +++ b/test/validator/samples/transition-duplicate-in/errors.json @@ -4,5 +4,9 @@ "line": 1, "column": 12 }, + "end": { + "line": 1, + "column": 18 + }, "pos": 12 }] \ No newline at end of file diff --git a/test/validator/samples/transition-duplicate-out-transition/errors.json b/test/validator/samples/transition-duplicate-out-transition/errors.json index f4bfa61ef0..6d9df9b0c7 100644 --- a/test/validator/samples/transition-duplicate-out-transition/errors.json +++ b/test/validator/samples/transition-duplicate-out-transition/errors.json @@ -4,5 +4,9 @@ "line": 1, "column": 13 }, + "end": { + "line": 1, + "column": 27 + }, "pos": 13 }] \ No newline at end of file diff --git a/test/validator/samples/transition-duplicate-out/errors.json b/test/validator/samples/transition-duplicate-out/errors.json index 988dc02bbe..524de7e4df 100644 --- a/test/validator/samples/transition-duplicate-out/errors.json +++ b/test/validator/samples/transition-duplicate-out/errors.json @@ -4,5 +4,9 @@ "line": 1, "column": 13 }, + "end": { + "line": 1, + "column": 20 + }, "pos": 13 }] \ No newline at end of file diff --git a/test/validator/samples/transition-duplicate-transition-in/errors.json b/test/validator/samples/transition-duplicate-transition-in/errors.json index 678ad4dd38..38b0883aba 100644 --- a/test/validator/samples/transition-duplicate-transition-in/errors.json +++ b/test/validator/samples/transition-duplicate-transition-in/errors.json @@ -4,5 +4,9 @@ "line": 1, "column": 20 }, + "end": { + "line": 1, + "column": 26 + }, "pos": 20 }] \ No newline at end of file diff --git a/test/validator/samples/transition-duplicate-transition-out/errors.json b/test/validator/samples/transition-duplicate-transition-out/errors.json index 31dc180b5a..07db9792f0 100644 --- a/test/validator/samples/transition-duplicate-transition-out/errors.json +++ b/test/validator/samples/transition-duplicate-transition-out/errors.json @@ -4,5 +4,9 @@ "line": 1, "column": 20 }, + "end": { + "line": 1, + "column": 27 + }, "pos": 20 }] \ No newline at end of file diff --git a/test/validator/samples/transition-duplicate-transition/errors.json b/test/validator/samples/transition-duplicate-transition/errors.json index 585ff37451..b1deba96f0 100644 --- a/test/validator/samples/transition-duplicate-transition/errors.json +++ b/test/validator/samples/transition-duplicate-transition/errors.json @@ -4,5 +4,9 @@ "line": 1, "column": 20 }, + "end": { + "line": 1, + "column": 34 + }, "pos": 20 }] \ No newline at end of file diff --git a/test/validator/samples/transition-missing/errors.json b/test/validator/samples/transition-missing/errors.json index 4f2b88c2f6..38ab5121a0 100644 --- a/test/validator/samples/transition-missing/errors.json +++ b/test/validator/samples/transition-missing/errors.json @@ -4,5 +4,9 @@ "line": 1, "column": 5 }, + "end": { + "line": 1, + "column": 11 + }, "pos": 5 }] \ No newline at end of file diff --git a/test/validator/samples/transition-on-component/errors.json b/test/validator/samples/transition-on-component/errors.json index d18125c8c2..99906238dc 100644 --- a/test/validator/samples/transition-on-component/errors.json +++ b/test/validator/samples/transition-on-component/errors.json @@ -4,5 +4,9 @@ "line": 1, "column": 8 }, + "end": { + "line": 1, + "column": 14 + }, "pos": 8 }] \ No newline at end of file diff --git a/test/validator/samples/window-binding-invalid-innerwidth/errors.json b/test/validator/samples/window-binding-invalid-innerwidth/errors.json index d4c5e99d18..891af56688 100644 --- a/test/validator/samples/window-binding-invalid-innerwidth/errors.json +++ b/test/validator/samples/window-binding-invalid-innerwidth/errors.json @@ -4,5 +4,9 @@ "line": 1, "column": 9 }, + "end": { + "line": 1, + "column": 28 + }, "pos": 9 }] \ No newline at end of file diff --git a/test/validator/samples/window-binding-invalid-value/errors.json b/test/validator/samples/window-binding-invalid-value/errors.json index 7f0c3f8b25..85672d4486 100644 --- a/test/validator/samples/window-binding-invalid-value/errors.json +++ b/test/validator/samples/window-binding-invalid-value/errors.json @@ -4,5 +4,9 @@ "line": 1, "column": 26 }, + "end": { + "line": 1, + "column": 37 + }, "pos": 26 }] \ No newline at end of file diff --git a/test/validator/samples/window-binding-invalid-width/errors.json b/test/validator/samples/window-binding-invalid-width/errors.json index b24b359611..4b10ce8531 100644 --- a/test/validator/samples/window-binding-invalid-width/errors.json +++ b/test/validator/samples/window-binding-invalid-width/errors.json @@ -4,5 +4,9 @@ "line": 1, "column": 9 }, + "end": { + "line": 1, + "column": 23 + }, "pos": 9 }] \ No newline at end of file diff --git a/test/validator/samples/window-binding-invalid/errors.json b/test/validator/samples/window-binding-invalid/errors.json index 26d82c444b..5b9dd2589c 100644 --- a/test/validator/samples/window-binding-invalid/errors.json +++ b/test/validator/samples/window-binding-invalid/errors.json @@ -4,5 +4,9 @@ "line": 1, "column": 9 }, + "end": { + "line": 1, + "column": 26 + }, "pos": 9 }] \ No newline at end of file