diff --git a/src/css/Selector.ts b/src/css/Selector.ts index 658f6dc52d..fba0386f1f 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`, selector); } } }); @@ -120,7 +120,7 @@ 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); + validator.error(`:global(...) can be at the start or end of a selector sequence, but not in the middle`, this.blocks[i].selectors[0]); } } } diff --git a/src/index.ts b/src/index.ts index be62f07763..cc3c0681e5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -146,4 +146,4 @@ export function create(source: string, _options: CompileOptions = {}) { } } -export { parse, validate, version as VERSION }; +export { parse, validate, Stylesheet, version as VERSION }; diff --git a/src/interfaces.ts b/src/interfaces.ts index 82de8cd047..de187da71d 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -29,6 +29,7 @@ export interface Parsed { export interface Warning { loc?: { line: number; column: number; pos?: number }; + end?: { line: number; column: number; }; pos?: number; message: string; filename?: string; 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/a11y.ts b/src/validate/html/a11y.ts index 1e07c0b4d4..e9953d6083 100644 --- a/src/validate/html/a11y.ts +++ b/src/validate/html/a11y.ts @@ -33,7 +33,7 @@ export default function a11y( if (name.startsWith('aria-')) { if (invisibleElements.has(node.name)) { // aria-unsupported-elements - validator.warn(`A11y: <${node.name}> should not have aria-* attributes`, attribute.start); + validator.warn(`A11y: <${node.name}> should not have aria-* attributes`, attribute); } const type = name.slice(5); @@ -42,7 +42,7 @@ export default function a11y( let message = `A11y: Unknown aria attribute 'aria-${type}'`; if (match) message += ` (did you mean '${match}'?)`; - validator.warn(message, attribute.start); + validator.warn(message, attribute); } } @@ -50,7 +50,7 @@ export default function a11y( if (name === 'role') { if (invisibleElements.has(node.name)) { // aria-unsupported-elements - validator.warn(`A11y: <${node.name}> should not have role attribute`, attribute.start); + validator.warn(`A11y: <${node.name}> should not have role attribute`, attribute); } const value = getStaticAttributeValue(node, 'role'); @@ -59,30 +59,30 @@ export default function a11y( let message = `A11y: Unknown role '${value}'`; if (match) message += ` (did you mean '${match}'?)`; - validator.warn(message, attribute.start); + validator.warn(message, attribute); } } // no-access-key if (name === 'accesskey') { - validator.warn(`A11y: Avoid using accesskey`, attribute.start); + validator.warn(`A11y: Avoid using accesskey`, attribute); } // no-autofocus if (name === 'autofocus') { - validator.warn(`A11y: Avoid using autofocus`, attribute.start); + validator.warn(`A11y: Avoid using autofocus`, attribute); } // scope if (name === 'scope' && node.name !== 'th') { - validator.warn(`A11y: The scope attribute should only be used with elements`, attribute.start); + validator.warn(`A11y: The scope attribute should only be used with elements`, attribute); } // tabindex-no-positive if (name === 'tabindex') { const value = getStaticAttributeValue(node, 'tabindex'); if (!isNaN(value) && +value > 0) { - validator.warn(`A11y: avoid tabindex values above zero`, attribute.start); + validator.warn(`A11y: avoid tabindex values above zero`, attribute); } } @@ -96,13 +96,13 @@ export default function a11y( attributes.slice(0, -1).join(', ') + ` or ${attributes[attributes.length - 1]}` : attributes[0]; - validator.warn(`A11y: <${name}> element should have ${article} ${sequence} attribute`, node.start); + validator.warn(`A11y: <${name}> element should have ${article} ${sequence} attribute`, node); } } function shouldHaveContent() { if (node.children.length === 0) { - validator.warn(`A11y: <${node.name}> element should have child content`, node.start); + validator.warn(`A11y: <${node.name}> element should have child content`, node); } } @@ -110,7 +110,7 @@ export default function a11y( const href = attributeMap.get(attribute); const value = getStaticAttributeValue(node, attribute); if (value === '' || value === '#') { - validator.warn(`A11y: '${value}' is not a valid ${attribute} attribute`, href.start); + validator.warn(`A11y: '${value}' is not a valid ${attribute} attribute`, href); } } @@ -122,7 +122,7 @@ export default function a11y( // anchor-in-svg-is-valid shouldHaveValidHref('xlink:href') } else { - validator.warn(`A11y: element should have an href attribute`, node.start); + validator.warn(`A11y: element should have an href attribute`, node); } // anchor-has-content @@ -141,7 +141,7 @@ export default function a11y( shouldHaveContent(); if (attributeMap.has('aria-hidden')) { - validator.warn(`A11y: <${node.name}> element should not be hidden`, attributeMap.get('aria-hidden').start); + validator.warn(`A11y: <${node.name}> element should not be hidden`, attributeMap.get('aria-hidden')); } } @@ -157,14 +157,14 @@ export default function a11y( // no-distracting-elements if (node.name === 'marquee' || node.name === 'blink') { - validator.warn(`A11y: Avoid <${node.name}> elements`, node.start); + validator.warn(`A11y: Avoid <${node.name}> elements`, node); } if (node.name === 'figcaption') { const parent = elementStack[elementStack.length - 1]; if (parent) { if (parent.name !== 'figure') { - validator.warn(`A11y:
must be an immediate child of
`, node.start); + validator.warn(`A11y:
must be an immediate child of
`, node); } else { const children = parent.children.filter(node => { if (node.type === 'Comment') return false; @@ -175,7 +175,7 @@ export default function a11y( const index = children.indexOf(node); if (index !== 0 && index !== children.length - 1) { - validator.warn(`A11y:
must be first or last child of
`, node.start); + validator.warn(`A11y:
must be first or last child of
`, node); } } } diff --git a/src/validate/html/index.ts b/src/validate/html/index.ts index 680b8b729b..36377f4065 100644 --- a/src/validate/html/index.ts +++ b/src/validate/html/index.ts @@ -52,7 +52,7 @@ export default function validateHtml(validator: Validator, html: Node) { else if (node.type === 'EachBlock') { if (validator.helpers.has(node.context)) { - let c = node.expression.end; + let c: number = node.expression.end; // find start of context while (/\s/.test(validator.source[c])) c += 1; @@ -61,13 +61,13 @@ export default function validateHtml(validator: Validator, html: Node) { validator.warn( `Context clashes with a helper. Rename one or the other to eliminate any ambiguity`, - c + { start: c, end: c + node.context.length } ); } } if (validator.options.dev && isEmptyBlock(node)) { - validator.warn('Empty block', node.start); + validator.warn('Empty block', node); } if (node.children) { @@ -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, callee); } }); } diff --git a/src/validate/html/validateElement.ts b/src/validate/html/validateElement.ts index 550f8d2ae7..9172854c7a 100644 --- a/src/validate/html/validateElement.ts +++ b/src/validate/html/validateElement.ts @@ -20,13 +20,13 @@ export default function validateElement( if (!isComponent && /^[A-Z]/.test(node.name[0])) { // TODO upgrade to validator.error in v2 - validator.warn(`${node.name} component is not defined`, node.start); + validator.warn(`${node.name} component is not defined`, node); } if (elementStack.length === 0 && validator.namespace !== namespaces.svg && svg.test(node.name)) { validator.warn( `<${node.name}> is an SVG element – did you forget to add { namespace: 'svg' } ?`, - node.start + node ); } @@ -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`, nameAttribute); } 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`, nameAttribute); } // TODO should duplicate slots be disallowed? Feels like it's more likely to be a @@ -63,7 +63,7 @@ export default function validateElement( if (node.attributes.length > 0) { validator.error( ` cannot have attributes`, - node.attributes[0].start + node.attributes[0] ); } @@ -71,7 +71,7 @@ export default function validateElement( if (child.type !== 'Text' && child.type !== 'MustacheTag') { validator.error( `<title> can only contain text and {{tags}}`, - child.start + child ); } }); @@ -98,7 +98,7 @@ export default function validateElement( ) { validator.error( `'value' is not a valid binding on <${node.name}> elements`, - attribute.start + attribute ); } @@ -107,21 +107,21 @@ export default function validateElement( if (node.name !== 'input') { validator.error( `'${name}' is not a valid binding on <${node.name}> elements`, - attribute.start + attribute ); } if (checkTypeAttribute(validator, node) !== 'checkbox') { validator.error( `'${name}' binding can only be used with <input type="checkbox">`, - attribute.start + attribute ); } } else if (name === 'group') { if (node.name !== 'input') { validator.error( `'group' is not a valid binding on <${node.name}> elements`, - attribute.start + attribute ); } @@ -130,7 +130,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 + attribute ); } } else if ( @@ -145,13 +145,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 + attribute ); } } else { validator.error( `'${attribute.name}' is not a valid binding`, - attribute.start + attribute ); } } else if (attribute.type === 'EventHandler') { @@ -159,7 +159,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`, attribute); } validator.used.transitions.add(attribute.name); @@ -170,13 +170,13 @@ export default function validateElement( if (bidi) validator.error( `An element can only have one 'transition' directive`, - attribute.start + attribute ); validator.error( `An element cannot have both a 'transition' directive and an '${attribute.intro ? 'in' : 'out'}' directive`, - attribute.start + attribute ); } @@ -186,11 +186,11 @@ export default function validateElement( `An element cannot have both an '${hasIntro ? 'in' : 'out'}' directive and a 'transition' directive`, - attribute.start + attribute ); validator.error( `An element can only have one '${hasIntro ? 'in' : 'out'}' directive`, - attribute.start + attribute ); } @@ -201,7 +201,7 @@ export default function validateElement( if (!validator.transitions.has(attribute.name)) { validator.error( `Missing transition '${attribute.name}'`, - attribute.start + attribute ); } } else if (attribute.type === 'Attribute') { @@ -209,7 +209,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 + attribute ); } } @@ -228,13 +228,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`, attribute); } if (isDynamic(attribute)) { validator.error( `'type' attribute cannot be dynamic if input uses two-way binding`, - attribute.start + attribute ); } @@ -245,7 +245,7 @@ function checkSlotAttribute(validator: Validator, node: Node, attribute: Node, s if (isDynamic(attribute)) { validator.error( `slot attribute cannot have a dynamic value`, - attribute.start + attribute ); } @@ -260,11 +260,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, attribute); } } - 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`, attribute); } function isDynamic(attribute: Node) { diff --git a/src/validate/html/validateEventHandler.ts b/src/validate/html/validateEventHandler.ts index 8e8a6122b3..bbe0ec626a 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`, attribute.expression); } const { name } = flattenReference(callee); @@ -30,7 +30,10 @@ export default function validateEventHandlerCallee( if (name === 'store' && attribute.expression.callee.type === 'MemberExpression') { if (!validator.options.store) { - validator.warn('compile with `store: true` in order to call store methods', attribute.expression.start); + validator.warn( + 'compile with `store: true` in order to call store methods', + attribute.expression + ); } return; } @@ -56,5 +59,5 @@ export default function validateEventHandlerCallee( message += `. '${callee.name}' exists on 'helpers', did you put it in the wrong place?`; } - validator.warn(message, start); + validator.warn(message, attribute.expression); } diff --git a/src/validate/html/validateHead.ts b/src/validate/html/validateHead.ts index bac56474b2..d57ffc426b 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`, node); } // TODO ensure only valid elements are included here diff --git a/src/validate/html/validateWindow.ts b/src/validate/html/validateWindow.ts index 3cfc80f6bc..36ed43a5a6 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 + attribute.value ); } @@ -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 + attribute ); } else { validator.error( `${message} — valid bindings are ${list(validBindings)}`, - attribute.start + attribute ); } } diff --git a/src/validate/index.ts b/src/validate/index.ts index f79cb1a55c..1c68a76306 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,23 +66,25 @@ 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); } - warn(message: string, pos: number) { + warn(message: string, pos: { start: number, end: number }) { if (!this.locator) this.locator = getLocator(this.source); - const { line, column } = this.locator(pos); + const start = this.locator(pos.start); + const end = this.locator(pos.end); - const frame = getCodeFrame(this.source, line, column); + const frame = getCodeFrame(this.source, start.line, start.column); this.onwarn({ message, frame, - loc: { line: line + 1, column }, - pos, + loc: { line: start.line + 1, column: start.column }, + end: { line: end.line + 1, column: end.column }, + pos: pos.start, filename: this.filename, - toString: () => `${message} (${line + 1}:${column})\n${frame}`, + toString: () => `${message} (${start.line + 1}:${start.column})\n${frame}`, }); } } @@ -148,7 +150,7 @@ export default function validate( if (!validator.used[category].has(name)) { validator.warn( `The '${name}' ${categories[category]} is unused`, - prop.start + prop ); } }); diff --git a/src/validate/js/index.ts b/src/validate/js/index.ts index be120c5a4a..927d3bf2f2 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`, node); } if (node.type === 'ExportDefaultDeclaration') { if (node.declaration.type !== 'ObjectExpression') { return validator.error( `Default export must be an object literal`, - node.declaration.start + node.declaration ); } @@ -37,14 +37,14 @@ export default function validateJs(validator: Validator, js: Node) { if (props.has('oncreate') && props.has('onrender')) { validator.error( 'Cannot have both oncreate and onrender', - props.get('onrender').start + props.get('onrender') ); } if (props.has('ondestroy') && props.has('onteardown')) { validator.error( 'Cannot have both ondestroy and onteardown', - props.get('onteardown').start + props.get('onteardown') ); } @@ -60,17 +60,17 @@ export default function validateJs(validator: Validator, js: Node) { if (match) { validator.error( `Unexpected property '${name}' (did you mean '${match}'?)`, - prop.start + prop ); } else if (/FunctionExpression/.test(prop.value.type)) { validator.error( `Unexpected property '${name}' (did you mean to include it in 'methods'?)`, - prop.start + prop ); } else { validator.error( `Unexpected property '${name}'`, - prop.start + prop ); } } diff --git a/src/validate/js/propValidators/components.ts b/src/validate/js/propValidators/components.ts index 943d4b005f..814b5c2142 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 + prop ); } @@ -21,12 +21,12 @@ 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 + component ); } if (!/^[A-Z]/.test(name)) { - validator.warn(`Component names should be capitalised`, component.start); + validator.warn(`Component names should be capitalised`, component); } }); } diff --git a/src/validate/js/propValidators/computed.ts b/src/validate/js/propValidators/computed.ts index 94a7212881..437b8d7f0d 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 + prop ); } @@ -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 + computation ); } if (reservedNames.has(name)) { validator.error( `Computed property name '${name}' is invalid — cannot be a JavaScript reserved word`, - computation.start + computation ); } if (!isFunctionExpression.has(computation.value.type)) { validator.error( `Computed properties can be function expressions or arrow function expressions`, - computation.value.start + computation.value ); } @@ -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 + node ); } 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 + node ); } }); @@ -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 + computation.value ); } @@ -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 + param ); } }); diff --git a/src/validate/js/propValidators/data.ts b/src/validate/js/propValidators/data.ts index 009e336b66..36a88960da 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`, prop.value); } } diff --git a/src/validate/js/propValidators/events.ts b/src/validate/js/propValidators/events.ts index 0f81fd7f4d..2660aac726 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 + prop ); } diff --git a/src/validate/js/propValidators/helpers.ts b/src/validate/js/propValidators/helpers.ts index 7c0cc4dcc1..20b32daca0 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 + prop ); } @@ -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 + node ); } 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 + node ); } else if (node.type === 'Identifier' && node.name === 'arguments') { usesArguments = true; @@ -43,7 +43,7 @@ export default function helpers(validator: Validator, prop: Node) { if (prop.value.params.length === 0 && !usesArguments) { validator.warn( `Helpers should be pure functions, with at least one argument`, - prop.start + prop ); } }); diff --git a/src/validate/js/propValidators/immutable.ts b/src/validate/js/propValidators/immutable.ts index b54521d9e4..39e6f3c422 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 + prop.value ); } } diff --git a/src/validate/js/propValidators/methods.ts b/src/validate/js/propValidators/methods.ts index c5b9bc220f..e09837a87e 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 + prop ); } @@ -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 + prop ); } @@ -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 + prop ); } } diff --git a/src/validate/js/propValidators/namespace.ts b/src/validate/js/propValidators/namespace.ts index 30e3ead77f..cf887df2bd 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 + prop ); } @@ -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 + prop ); } else { - validator.error(`Invalid namespace '${ns}'`, prop.start); + validator.error(`Invalid namespace '${ns}'`, prop); } } } diff --git a/src/validate/js/propValidators/oncreate.ts b/src/validate/js/propValidators/oncreate.ts index 587a8b3679..c1ed2b5743 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 + prop ); } } diff --git a/src/validate/js/propValidators/ondestroy.ts b/src/validate/js/propValidators/ondestroy.ts index e12525e73f..988592a4f8 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 + prop ); } } diff --git a/src/validate/js/propValidators/onrender.ts b/src/validate/js/propValidators/onrender.ts index fd6751a373..a3dd00d78c 100644 --- a/src/validate/js/propValidators/onrender.ts +++ b/src/validate/js/propValidators/onrender.ts @@ -5,7 +5,7 @@ import { Node } from '../../../interfaces'; export default function onrender(validator: Validator, prop: Node) { validator.warn( `'onrender' has been deprecated in favour of 'oncreate', and will cause an error in Svelte 2.x`, - prop.start + prop ); oncreate(validator, prop); } diff --git a/src/validate/js/propValidators/onteardown.ts b/src/validate/js/propValidators/onteardown.ts index cca770909c..f69df302c2 100644 --- a/src/validate/js/propValidators/onteardown.ts +++ b/src/validate/js/propValidators/onteardown.ts @@ -5,7 +5,7 @@ import { Node } from '../../../interfaces'; export default function onteardown(validator: Validator, prop: Node) { validator.warn( `'onteardown' has been deprecated in favour of 'ondestroy', and will cause an error in Svelte 2.x`, - prop.start + prop ); ondestroy(validator, prop); } diff --git a/src/validate/js/propValidators/props.ts b/src/validate/js/propValidators/props.ts index 408e72a7f5..57c1fb78ef 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 + prop.value ); } @@ -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 + element ); } }); diff --git a/src/validate/js/propValidators/setup.ts b/src/validate/js/propValidators/setup.ts index 7e4c21ce3b..f98d78cb6b 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`, prop.value); } } diff --git a/src/validate/js/propValidators/tag.ts b/src/validate/js/propValidators/tag.ts index c64381fc54..18b79760d9 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 + prop.value ); } @@ -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 + prop.value ); } } diff --git a/src/validate/js/propValidators/transitions.ts b/src/validate/js/propValidators/transitions.ts index 1bd8e677bc..4675f9fd92 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 + prop ); } diff --git a/src/validate/js/utils/checkForAccessors.ts b/src/validate/js/utils/checkForAccessors.ts index 6c00d3a23a..2445707a1c 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`, prop); } }); } diff --git a/src/validate/js/utils/checkForComputedKeys.ts b/src/validate/js/utils/checkForComputedKeys.ts index cf3892d02c..61e7efabbe 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`, prop); } }); } diff --git a/src/validate/js/utils/checkForDupes.ts b/src/validate/js/utils/checkForDupes.ts index 0473d7a265..42fbcd137d 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}'`, prop); } seen.add(name); diff --git a/test/validator/index.js b/test/validator/index.js index 6fa792dbde..4961e71265 100644 --- a/test/validator/index.js +++ b/test/validator/index.js @@ -31,7 +31,8 @@ describe("validate", () => { warnings.push({ message: warning.message, pos: warning.pos, - loc: warning.loc + loc: warning.loc, + end: warning.end, }); }, dev: config.dev @@ -55,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/a11y-alt-text/warnings.json b/test/validator/samples/a11y-alt-text/warnings.json index 7bddf9730b..dd5d319884 100644 --- a/test/validator/samples/a11y-alt-text/warnings.json +++ b/test/validator/samples/a11y-alt-text/warnings.json @@ -5,6 +5,10 @@ "line": 1, "column": 0 }, + "end": { + "line": 1, + "column": 19 + }, "pos": 0 }, @@ -14,6 +18,10 @@ "line": 4, "column": 1 }, + "end": { + "line": 4, + "column": 7 + }, "pos": 28 }, @@ -23,6 +31,10 @@ "line": 7, "column": 0 }, + "end": { + "line": 7, + "column": 17 + }, "pos": 43 }, @@ -32,6 +44,10 @@ "line": 9, "column": 0 }, + "end": { + "line": 9, + "column": 20 + }, "pos": 62 } ] diff --git a/test/validator/samples/a11y-anchor-has-content/warnings.json b/test/validator/samples/a11y-anchor-has-content/warnings.json index 157bec1f9b..ed8f6ad454 100644 --- a/test/validator/samples/a11y-anchor-has-content/warnings.json +++ b/test/validator/samples/a11y-anchor-has-content/warnings.json @@ -4,5 +4,9 @@ "line": 1, "column": 0 }, + "end": { + "line": 1, + "column": 19 + }, "pos": 0 }] \ No newline at end of file diff --git a/test/validator/samples/a11y-anchor-in-svg-is-valid/warnings.json b/test/validator/samples/a11y-anchor-in-svg-is-valid/warnings.json index 1e65bc4986..fac62f3e13 100644 --- a/test/validator/samples/a11y-anchor-in-svg-is-valid/warnings.json +++ b/test/validator/samples/a11y-anchor-in-svg-is-valid/warnings.json @@ -5,6 +5,10 @@ "line": 1, "column": 11 }, + "end": { + "line": 1, + "column": 37 + }, "pos": 11 }, { @@ -13,6 +17,10 @@ "line": 2, "column": 14 }, + "end": { + "line": 2, + "column": 27 + }, "pos": 65 }, { @@ -21,6 +29,10 @@ "line": 3, "column": 14 }, + "end": { + "line": 3, + "column": 28 + }, "pos": 130 } ] diff --git a/test/validator/samples/a11y-anchor-is-valid/warnings.json b/test/validator/samples/a11y-anchor-is-valid/warnings.json index c63418f1bf..86135b84c9 100644 --- a/test/validator/samples/a11y-anchor-is-valid/warnings.json +++ b/test/validator/samples/a11y-anchor-is-valid/warnings.json @@ -5,6 +5,10 @@ "line": 1, "column": 0 }, + "end": { + "line": 1, + "column": 26 + }, "pos": 0 }, { @@ -13,6 +17,10 @@ "line": 2, "column": 3 }, + "end": { + "line": 2, + "column": 10 + }, "pos": 30 }, { @@ -21,6 +29,10 @@ "line": 3, "column": 3 }, + "end": { + "line": 3, + "column": 11 + }, "pos": 53 } ] diff --git a/test/validator/samples/a11y-aria-props/warnings.json b/test/validator/samples/a11y-aria-props/warnings.json index 5c0ce2c49e..7f2880dc34 100644 --- a/test/validator/samples/a11y-aria-props/warnings.json +++ b/test/validator/samples/a11y-aria-props/warnings.json @@ -5,6 +5,10 @@ "line": 1, "column": 20 }, + "end": { + "line": 1, + "column": 40 + }, "pos": 20 }, @@ -14,6 +18,10 @@ "column": 0, "line": 1 }, + "end": { + "line": 1, + "column": 41 + }, "pos": 0 } ] diff --git a/test/validator/samples/a11y-aria-role/warnings.json b/test/validator/samples/a11y-aria-role/warnings.json index 152a27daa8..903381b295 100644 --- a/test/validator/samples/a11y-aria-role/warnings.json +++ b/test/validator/samples/a11y-aria-role/warnings.json @@ -5,6 +5,10 @@ "line": 1, "column": 5 }, + "end": { + "line": 1, + "column": 20 + }, "pos": 5 } ] diff --git a/test/validator/samples/a11y-aria-unsupported-element/warnings.json b/test/validator/samples/a11y-aria-unsupported-element/warnings.json index 5e2c358271..369b81278c 100644 --- a/test/validator/samples/a11y-aria-unsupported-element/warnings.json +++ b/test/validator/samples/a11y-aria-unsupported-element/warnings.json @@ -5,6 +5,10 @@ "line": 1, "column": 6 }, + "end": { + "line": 1, + "column": 25 + }, "pos": 6 }, @@ -14,6 +18,10 @@ "line": 2, "column": 6 }, + "end": { + "line": 2, + "column": 20 + }, "pos": 33 } ] diff --git a/test/validator/samples/a11y-figcaption-wrong-place/warnings.json b/test/validator/samples/a11y-figcaption-wrong-place/warnings.json index 0e5e1a1976..ed1edb3f8c 100644 --- a/test/validator/samples/a11y-figcaption-wrong-place/warnings.json +++ b/test/validator/samples/a11y-figcaption-wrong-place/warnings.json @@ -5,6 +5,10 @@ "line": 4, "column": 1 }, + "end": { + "line": 6, + "column": 14 + }, "pos": 57 }, { @@ -13,6 +17,10 @@ "line": 15, "column": 2 }, + "end": { + "line": 17, + "column": 15 + }, "pos": 252 } ] diff --git a/test/validator/samples/a11y-heading-has-content/warnings.json b/test/validator/samples/a11y-heading-has-content/warnings.json index 15bb3a162a..c269dd9e4b 100644 --- a/test/validator/samples/a11y-heading-has-content/warnings.json +++ b/test/validator/samples/a11y-heading-has-content/warnings.json @@ -5,6 +5,10 @@ "line": 1, "column": 0 }, + "end": { + "line": 1, + "column": 9 + }, "pos": 0 }, @@ -14,6 +18,10 @@ "line": 2, "column": 4 }, + "end": { + "line": 2, + "column": 15 + }, "pos": 14 } ] diff --git a/test/validator/samples/a11y-html-has-lang/warnings.json b/test/validator/samples/a11y-html-has-lang/warnings.json index f64964bf6a..26afa41fa9 100644 --- a/test/validator/samples/a11y-html-has-lang/warnings.json +++ b/test/validator/samples/a11y-html-has-lang/warnings.json @@ -4,6 +4,10 @@ "column": 0, "line": 5 }, + "end": { + "line": 5, + "column": 13 + }, "message": "A11y: <html> element should have a lang attribute", "pos": 84 } diff --git a/test/validator/samples/a11y-iframe-has-title/warnings.json b/test/validator/samples/a11y-iframe-has-title/warnings.json index 8f69f14415..3d38672b76 100644 --- a/test/validator/samples/a11y-iframe-has-title/warnings.json +++ b/test/validator/samples/a11y-iframe-has-title/warnings.json @@ -5,6 +5,10 @@ "line": 1, "column": 0 }, + "end": { + "line": 1, + "column": 31 + }, "pos": 0 } ] diff --git a/test/validator/samples/a11y-no-access-key/warnings.json b/test/validator/samples/a11y-no-access-key/warnings.json index 40a8381aed..4d9e1a3eec 100644 --- a/test/validator/samples/a11y-no-access-key/warnings.json +++ b/test/validator/samples/a11y-no-access-key/warnings.json @@ -4,5 +4,9 @@ "line": 1, "column": 5 }, + "end": { + "line": 1, + "column": 18 + }, "pos": 5 }] \ No newline at end of file diff --git a/test/validator/samples/a11y-no-autofocus/warnings.json b/test/validator/samples/a11y-no-autofocus/warnings.json index 26544e9afc..9d820ea234 100644 --- a/test/validator/samples/a11y-no-autofocus/warnings.json +++ b/test/validator/samples/a11y-no-autofocus/warnings.json @@ -4,5 +4,9 @@ "line": 1, "column": 5 }, + "end": { + "line": 1, + "column": 14 + }, "pos": 5 }] \ No newline at end of file diff --git a/test/validator/samples/a11y-no-distracting-elements/warnings.json b/test/validator/samples/a11y-no-distracting-elements/warnings.json index 3b54de094f..fa2bae30fa 100644 --- a/test/validator/samples/a11y-no-distracting-elements/warnings.json +++ b/test/validator/samples/a11y-no-distracting-elements/warnings.json @@ -5,6 +5,10 @@ "line": 1, "column": 0 }, + "end": { + "line": 1, + "column": 10 + }, "pos": 0 }, @@ -14,6 +18,10 @@ "line": 2, "column": 0 }, + "end": { + "line": 2, + "column": 8 + }, "pos": 11 } ] diff --git a/test/validator/samples/a11y-not-on-components/warnings.json b/test/validator/samples/a11y-not-on-components/warnings.json index 319a2aef81..3f48bddc27 100644 --- a/test/validator/samples/a11y-not-on-components/warnings.json +++ b/test/validator/samples/a11y-not-on-components/warnings.json @@ -5,6 +5,10 @@ "column": 8, "line": 2 }, + "end": { + "line": 2, + "column": 17 + }, "pos": 29 } ] diff --git a/test/validator/samples/a11y-scope/warnings.json b/test/validator/samples/a11y-scope/warnings.json index 684a75dad6..2b82756ede 100644 --- a/test/validator/samples/a11y-scope/warnings.json +++ b/test/validator/samples/a11y-scope/warnings.json @@ -5,6 +5,10 @@ "line": 1, "column": 5 }, + "end": { + "line": 1, + "column": 10 + }, "pos": 5 } ] diff --git a/test/validator/samples/a11y-tabindex-no-positive/warnings.json b/test/validator/samples/a11y-tabindex-no-positive/warnings.json index 6c163a8834..9b72a6a15b 100644 --- a/test/validator/samples/a11y-tabindex-no-positive/warnings.json +++ b/test/validator/samples/a11y-tabindex-no-positive/warnings.json @@ -5,6 +5,10 @@ "line": 3, "column": 5 }, + "end": { + "line": 3, + "column": 17 + }, "pos": 46 } ] 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/empty-block-dev/warnings.json b/test/validator/samples/empty-block-dev/warnings.json index 54584bf135..158bb7aac7 100644 --- a/test/validator/samples/empty-block-dev/warnings.json +++ b/test/validator/samples/empty-block-dev/warnings.json @@ -5,6 +5,10 @@ "line": 1, "column": 0 }, + "end": { + "line": 3, + "column": 9 + }, "pos": 0 }, { @@ -13,6 +17,10 @@ "line": 5, "column": 0 }, + "end": { + "line": 5, + "column": 34 + }, "pos": 38 } ] \ 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-clash-context/warnings.json b/test/validator/samples/helper-clash-context/warnings.json index e71b4edb59..8e3c3d045a 100644 --- a/test/validator/samples/helper-clash-context/warnings.json +++ b/test/validator/samples/helper-clash-context/warnings.json @@ -4,5 +4,9 @@ "line": 1, "column": 18 }, + "end": { + "line": 1, + "column": 23 + }, "pos": 18 }] \ No newline at end of file diff --git a/test/validator/samples/helper-purity-check-needs-arguments/warnings.json b/test/validator/samples/helper-purity-check-needs-arguments/warnings.json index 85abc4df92..16c9f8e947 100644 --- a/test/validator/samples/helper-purity-check-needs-arguments/warnings.json +++ b/test/validator/samples/helper-purity-check-needs-arguments/warnings.json @@ -4,5 +4,9 @@ "loc": { "line": 6, "column": 3 + }, + "end": { + "line": 8, + "column": 4 } }] \ No newline at end of file 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/method-nonexistent-helper/warnings.json b/test/validator/samples/method-nonexistent-helper/warnings.json index 88a5b7e03c..b5f49032f5 100644 --- a/test/validator/samples/method-nonexistent-helper/warnings.json +++ b/test/validator/samples/method-nonexistent-helper/warnings.json @@ -4,5 +4,9 @@ "loc": { "line": 1, "column": 18 + }, + "end": { + "line": 1, + "column": 23 } }] diff --git a/test/validator/samples/method-nonexistent/warnings.json b/test/validator/samples/method-nonexistent/warnings.json index c5117ae98c..ba10766dcb 100644 --- a/test/validator/samples/method-nonexistent/warnings.json +++ b/test/validator/samples/method-nonexistent/warnings.json @@ -4,5 +4,9 @@ "loc": { "line": 1, "column": 18 + }, + "end": { + "line": 1, + "column": 23 } }] diff --git a/test/validator/samples/missing-component/warnings.json b/test/validator/samples/missing-component/warnings.json index c3a3be4d02..21e6f8674b 100644 --- a/test/validator/samples/missing-component/warnings.json +++ b/test/validator/samples/missing-component/warnings.json @@ -4,5 +4,9 @@ "line": 2, "column": 1 }, + "end": { + "line": 2, + "column": 10 + }, "pos": 7 }] \ No newline at end of file diff --git a/test/validator/samples/named-export/errors.json b/test/validator/samples/named-export/errors.json index ce27a91863..331f66c8c9 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": 21 } }] 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-components-should-be-capitalised/warnings.json b/test/validator/samples/properties-components-should-be-capitalised/warnings.json index 8be7714b33..46ec8c85c4 100644 --- a/test/validator/samples/properties-components-should-be-capitalised/warnings.json +++ b/test/validator/samples/properties-components-should-be-capitalised/warnings.json @@ -4,5 +4,9 @@ "line": 6, "column": 3 }, + "end": { + "line": 6, + "column": 6 + }, "pos": 59 }] 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/store-unexpected/warnings.json b/test/validator/samples/store-unexpected/warnings.json index bac2841dc9..6c4d57beb1 100644 --- a/test/validator/samples/store-unexpected/warnings.json +++ b/test/validator/samples/store-unexpected/warnings.json @@ -4,5 +4,9 @@ "line": 1, "column": 18 }, + "end": { + "line": 1, + "column": 29 + }, "pos": 18 }] \ No newline at end of file diff --git a/test/validator/samples/svg-child-component-undeclared-namespace/warnings.json b/test/validator/samples/svg-child-component-undeclared-namespace/warnings.json index d17aa5c53d..316fbd767f 100644 --- a/test/validator/samples/svg-child-component-undeclared-namespace/warnings.json +++ b/test/validator/samples/svg-child-component-undeclared-namespace/warnings.json @@ -4,6 +4,10 @@ "line": 1, "column": 0 }, + "end": { + "line": 1, + "column": 65 + }, "pos": 0 }, { @@ -12,6 +16,10 @@ "column": 1, "line": 5 }, + "end": { + "line": 5, + "column": 66 + }, "pos": 90 }, { @@ -20,6 +28,10 @@ "column": 2, "line": 10 }, + "end": { + "line": 10, + "column": 67 + }, "pos": 191 }, { @@ -28,6 +40,10 @@ "column": 2, "line": 20 }, + "end": { + "line": 20, + "column": 67 + }, "pos": 333 }, { @@ -36,5 +52,9 @@ "column": 2, "line": 26 }, + "end": { + "line": 26, + "column": 67 + }, "pos": 445 }] 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/unused-components/warnings.json b/test/validator/samples/unused-components/warnings.json index 48e3d80bc9..a71c8ca4e1 100644 --- a/test/validator/samples/unused-components/warnings.json +++ b/test/validator/samples/unused-components/warnings.json @@ -5,6 +5,10 @@ "line": 7, "column": 3 }, + "end": { + "line": 7, + "column": 6 + }, "pos": 109 }, { @@ -13,6 +17,10 @@ "line": 8, "column": 3 }, + "end": { + "line": 8, + "column": 6 + }, "pos": 117 } ] diff --git a/test/validator/samples/unused-event/warnings.json b/test/validator/samples/unused-event/warnings.json index 88a47fbf86..e0e8c65b9d 100644 --- a/test/validator/samples/unused-event/warnings.json +++ b/test/validator/samples/unused-event/warnings.json @@ -4,5 +4,9 @@ "line": 4, "column": 3 }, + "end": { + "line": 6, + "column": 4 + }, "pos": 42 }] diff --git a/test/validator/samples/unused-transition/warnings.json b/test/validator/samples/unused-transition/warnings.json index da1952b060..f35ee39fc1 100644 --- a/test/validator/samples/unused-transition/warnings.json +++ b/test/validator/samples/unused-transition/warnings.json @@ -4,5 +4,9 @@ "line": 4, "column": 3 }, + "end": { + "line": 6, + "column": 4 + }, "pos": 47 }] 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 diff --git a/test/validator/samples/window-event-invalid/warnings.json b/test/validator/samples/window-event-invalid/warnings.json index 5dca33bf5c..a5287ecfa2 100644 --- a/test/validator/samples/window-event-invalid/warnings.json +++ b/test/validator/samples/window-event-invalid/warnings.json @@ -4,5 +4,9 @@ "line": 1, "column": 20 }, + "end": { + "line": 1, + "column": 28 + }, "pos": 20 }]