rename loc to start, include character info in locations

pull/1348/head
Rich Harris 7 years ago
parent 07bad96719
commit 5a457bfb87

@ -58,7 +58,7 @@
"glob": "^7.1.1", "glob": "^7.1.1",
"is-reference": "^1.1.0", "is-reference": "^1.1.0",
"jsdom": "^11.6.1", "jsdom": "^11.6.1",
"locate-character": "^2.0.0", "locate-character": "^2.0.5",
"magic-string": "^0.22.3", "magic-string": "^0.22.3",
"mocha": "^3.2.0", "mocha": "^3.2.0",
"nightmare": "^2.10.0", "nightmare": "^2.10.0",

@ -392,20 +392,22 @@ export default class Stylesheet {
const handler = (selector: Selector) => { const handler = (selector: Selector) => {
const pos = selector.node.start; const pos = selector.node.start;
if (!locator) locator = getLocator(this.source); if (!locator) locator = getLocator(this.source, { offsetLine: 1 });
const { line, column } = locator(pos); const start = locator(pos);
const end = locator(selector.node.end);
const frame = getCodeFrame(this.source, line, column); const frame = getCodeFrame(this.source, start.line - 1, start.column);
const message = `Unused CSS selector`; const message = `Unused CSS selector`;
onwarn({ onwarn({
code: `css-unused-selector`, code: `css-unused-selector`,
message, message,
frame, frame,
loc: { line: line + 1, column }, start,
end,
pos, pos,
filename: this.filename, filename: this.filename,
toString: () => `${message} (${line + 1}:${column})\n${frame}`, toString: () => `${message} (${start.line}:${start.column})\n${frame}`,
}); });
}; };

@ -5,7 +5,6 @@ import { getLocator } from 'locate-character';
import Stats from '../Stats'; import Stats from '../Stats';
import deindent from '../utils/deindent'; import deindent from '../utils/deindent';
import CodeBuilder from '../utils/CodeBuilder'; import CodeBuilder from '../utils/CodeBuilder';
import getCodeFrame from '../utils/getCodeFrame';
import flattenReference from '../utils/flattenReference'; import flattenReference from '../utils/flattenReference';
import reservedNames from '../utils/reservedNames'; import reservedNames from '../utils/reservedNames';
import namespaces from '../utils/namespaces'; import namespaces from '../utils/namespaces';

@ -23,9 +23,9 @@ function normalizeOptions(options: CompileOptions): CompileOptions {
} }
function defaultOnwarn(warning: Warning) { function defaultOnwarn(warning: Warning) {
if (warning.loc) { if (warning.start) {
console.warn( console.warn(
`(${warning.loc.line}:${warning.loc.column}) ${warning.message}` `(${warning.start.line}:${warning.start.column}) ${warning.message}`
); // eslint-disable-line no-console ); // eslint-disable-line no-console
} else { } else {
console.warn(warning.message); // eslint-disable-line no-console console.warn(warning.message); // eslint-disable-line no-console

@ -28,7 +28,7 @@ export interface Parsed {
} }
export interface Warning { export interface Warning {
loc?: { line: number; column: number; pos?: number }; start?: { line: number; column: number; pos?: number };
end?: { line: number; column: number; }; end?: { line: number; column: number; };
pos?: number; pos?: number;
code: string; code: string;

@ -3,7 +3,6 @@ import { locate, Location } from 'locate-character';
import fragment from './state/fragment'; import fragment from './state/fragment';
import { whitespace } from '../utils/patterns'; import { whitespace } from '../utils/patterns';
import { trimStart, trimEnd } from '../utils/trim'; import { trimStart, trimEnd } from '../utils/trim';
import getCodeFrame from '../utils/getCodeFrame';
import reservedNames from '../utils/reservedNames'; import reservedNames from '../utils/reservedNames';
import fullCharCodeAt from '../utils/fullCharCodeAt'; import fullCharCodeAt from '../utils/fullCharCodeAt';
import hash from '../utils/hash'; import hash from '../utils/hash';

@ -3,14 +3,14 @@ import getCodeFrame from '../utils/getCodeFrame';
class CompileError extends Error { class CompileError extends Error {
code: string; code: string;
loc: { line: number, column: number }; start: { line: number, column: number };
end: { line: number, column: number }; end: { line: number, column: number };
pos: number; pos: number;
filename: string; filename: string;
frame: string; frame: string;
toString() { toString() {
return `${this.message} (${this.loc.line}:${this.loc.column})\n${this.frame}`; return `${this.message} (${this.start.line}:${this.start.column})\n${this.frame}`;
} }
} }
@ -25,16 +25,16 @@ export default function error(message: string, props: {
const error = new CompileError(message); const error = new CompileError(message);
error.name = props.name; error.name = props.name;
const start = locate(props.source, props.start); const start = locate(props.source, props.start, { offsetLine: 1 });
const end = locate(props.source, props.end || props.start); const end = locate(props.source, props.end || props.start, { offsetLine: 1 });
error.code = props.code; error.code = props.code;
error.loc = { line: start.line + 1, column: start.column }; error.start = start;
error.end = { line: end.line + 1, column: end.column }; error.end = end;
error.pos = props.start; error.pos = props.start;
error.filename = props.filename; error.filename = props.filename;
error.frame = getCodeFrame(props.source, start.line, start.column); error.frame = getCodeFrame(props.source, start.line - 1, start.column);
throw error; throw error;
} }

@ -73,18 +73,18 @@ export class Validator {
} }
warn(pos: { start: number, end: number }, { code, message }: { code: string, message: string }) { warn(pos: { start: number, end: number }, { code, message }: { code: string, message: string }) {
if (!this.locator) this.locator = getLocator(this.source); if (!this.locator) this.locator = getLocator(this.source, { offsetLine: 1 });
const start = this.locator(pos.start); const start = this.locator(pos.start);
const end = this.locator(pos.end); const end = this.locator(pos.end);
const frame = getCodeFrame(this.source, start.line, start.column); const frame = getCodeFrame(this.source, start.line - 1, start.column);
this.stats.warn({ this.stats.warn({
code, code,
message, message,
frame, frame,
loc: { line: start.line + 1, column: start.column }, start,
end: { line: end.line + 1, column: end.column }, end,
pos: pos.start, pos: pos.start,
filename: this.filename, filename: this.filename,
toString: () => `${message} (${start.line + 1}:${start.column})\n${frame}`, toString: () => `${message} (${start.line + 1}:${start.column})\n${frame}`,

@ -3,9 +3,15 @@ export default {
filename: "SvelteComponent.html", filename: "SvelteComponent.html",
code: `css-unused-selector`, code: `css-unused-selector`,
message: "Unused CSS selector", message: "Unused CSS selector",
loc: { start: {
line: 4, line: 4,
column: 1 column: 1,
character: 31
},
end: {
line: 4,
column: 3,
character: 33
}, },
pos: 31, pos: 31,
frame: ` frame: `

@ -2,9 +2,15 @@ export default {
warnings: [{ warnings: [{
code: `css-unused-selector`, code: `css-unused-selector`,
message: 'Unused CSS selector', message: 'Unused CSS selector',
loc: { start: {
line: 8, line: 8,
column: 1 column: 1,
character: 74
},
end: {
line: 8,
column: 8,
character: 81
}, },
pos: 74, pos: 74,
frame: ` frame: `

@ -6,9 +6,15 @@ export default {
warnings: [{ warnings: [{
code: `css-unused-selector`, code: `css-unused-selector`,
message: 'Unused CSS selector', message: 'Unused CSS selector',
loc: { start: {
column: 1, column: 1,
line: 12 line: 12,
character: 169
},
end: {
column: 20,
line: 12,
character: 188
}, },
pos: 169, pos: 169,
frame: ` frame: `

@ -2,9 +2,15 @@ export default {
warnings: [{ warnings: [{
code: `css-unused-selector`, code: `css-unused-selector`,
message: 'Unused CSS selector', message: 'Unused CSS selector',
loc: { start: {
column: 1, column: 1,
line: 14 line: 14,
character: 120
},
end: {
column: 6,
line: 14,
character: 125
}, },
pos: 120, pos: 120,
frame: ` frame: `

@ -4,9 +4,15 @@ export default {
filename: "SvelteComponent.html", filename: "SvelteComponent.html",
code: `css-unused-selector`, code: `css-unused-selector`,
message: "Unused CSS selector", message: "Unused CSS selector",
loc: { start: {
line: 4, line: 4,
column: 1 column: 1,
character: 34
},
end: {
line: 4,
column: 5,
character: 38
}, },
pos: 34, pos: 34,
frame: ` frame: `
@ -22,9 +28,15 @@ export default {
filename: "SvelteComponent.html", filename: "SvelteComponent.html",
code: `css-unused-selector`, code: `css-unused-selector`,
message: "Unused CSS selector", message: "Unused CSS selector",
loc: { start: {
line: 4,
column: 13,
character: 46
},
end: {
line: 4, line: 4,
column: 13 column: 17,
character: 50
}, },
pos: 46, pos: 46,
frame: ` frame: `

@ -7,9 +7,15 @@ export default {
filename: "SvelteComponent.html", filename: "SvelteComponent.html",
code: `css-unused-selector`, code: `css-unused-selector`,
message: "Unused CSS selector", message: "Unused CSS selector",
loc: { start: {
line: 12, line: 12,
column: 1 column: 1,
character: 123
},
end: {
line: 12,
column: 13,
character: 135
}, },
pos: 123, pos: 123,
frame: ` frame: `

@ -3,9 +3,15 @@ export default {
filename: "SvelteComponent.html", filename: "SvelteComponent.html",
code: `css-unused-selector`, code: `css-unused-selector`,
message: "Unused CSS selector", message: "Unused CSS selector",
loc: { start: {
line: 8, line: 8,
column: 1 column: 1,
character: 60
},
end: {
line: 8,
column: 5,
character: 64
}, },
pos: 60, pos: 60,
frame: ` frame: `

@ -71,7 +71,7 @@ describe("js", () => {
expectedBundle.trim().replace(/^[ \t]+$/gm, "") expectedBundle.trim().replace(/^[ \t]+$/gm, "")
); );
}).catch(err => { }).catch(err => {
if (err.loc) console.error(err.loc); if (err.start) console.error(err.start);
throw err; throw err;
}); });
}); });

@ -37,9 +37,9 @@ describe('parse', () => {
try { try {
assert.equal(err.code, expectedError.code); assert.equal(err.code, expectedError.code);
assert.equal(err.message, expectedError.message); assert.equal(err.message, expectedError.message);
assert.deepEqual(err.loc, expectedError.loc); assert.deepEqual(err.start, expectedError.start);
assert.equal(err.pos, expectedError.pos); assert.equal(err.pos, expectedError.pos);
assert.equal(err.toString().split('\n')[0], `${expectedError.message} (${expectedError.loc.line}:${expectedError.loc.column})`); assert.equal(err.toString().split('\n')[0], `${expectedError.message} (${expectedError.start.line}:${expectedError.start.column})`);
} catch (err2) { } catch (err2) {
const e = err2.code === 'MODULE_NOT_FOUND' ? err : err2; const e = err2.code === 'MODULE_NOT_FOUND' ? err : err2;
throw e; throw e;

@ -1,9 +1,10 @@
{ {
"code": "duplicate-attribute", "code": "duplicate-attribute",
"message": "Attributes need to be unique", "message": "Attributes need to be unique",
"loc": { "start": {
"line": 1, "line": 1,
"column": 17 "column": 17,
"character": 17
}, },
"pos": 17 "pos": 17
} }

@ -1,9 +1,10 @@
{ {
"code": "binding-disabled", "code": "binding-disabled",
"message": "Two-way binding is disabled", "message": "Two-way binding is disabled",
"loc": { "start": {
"line": 1, "line": 1,
"column": 7 "column": 7,
"character": 7
}, },
"pos": 7 "pos": 7
} }

@ -1,9 +1,10 @@
{ {
"code": "invalid-directive-value", "code": "invalid-directive-value",
"message": "directive values should not be wrapped — use 'foo', not '{foo}'", "message": "directive values should not be wrapped — use 'foo', not '{foo}'",
"loc": { "start": {
"line": 1, "line": 1,
"column": 19 "column": 19,
"character": 19
}, },
"pos": 19 "pos": 19
} }

@ -2,8 +2,9 @@
"code": "invalid-directive-value", "code": "invalid-directive-value",
"message": "Can only bind to an identifier (e.g. `foo`) or a member expression (e.g. `foo.bar` or `foo[baz]`)", "message": "Can only bind to an identifier (e.g. `foo`) or a member expression (e.g. `foo.bar` or `foo[baz]`)",
"pos": 19, "pos": 19,
"loc": { "start": {
"line": 1, "line": 1,
"column": 19 "column": 19,
"character": 19
} }
} }

@ -1,9 +1,10 @@
{ {
"code": "unexpected-eof", "code": "unexpected-eof",
"message": "comment was left open, expected -->", "message": "comment was left open, expected -->",
"loc": { "start": {
"line": 1, "line": 1,
"column": 24 "column": 24,
"character": 24
}, },
"pos": 24 "pos": 24
} }

@ -1,9 +1,10 @@
{ {
"code": "css-syntax-error", "code": "css-syntax-error",
"message": "LeftCurlyBracket is expected", "message": "LeftCurlyBracket is expected",
"loc": { "start": {
"line": 2, "line": 2,
"column": 16 "column": 16,
"character": 24
}, },
"pos": 24 "pos": 24
} }

@ -1,9 +1,10 @@
{ {
"code": "invalid-directive-value", "code": "invalid-directive-value",
"message": "Expected a method call", "message": "Expected a method call",
"loc": { "start": {
"line": 1, "line": 1,
"column": 15 "column": 15,
"character": 15
}, },
"pos": 15 "pos": 15
} }

@ -1,9 +1,10 @@
{ {
"code": "parse-error", "code": "parse-error",
"message": "Assigning to rvalue", "message": "Assigning to rvalue",
"loc": { "start": {
"line": 1, "line": 1,
"column": 1 "column": 1,
"character": 1
}, },
"pos": 1 "pos": 1
} }

@ -1,9 +1,10 @@
{ {
"code": "duplicate-style", "code": "duplicate-style",
"message": "You can only have one top-level <style> tag per component", "message": "You can only have one top-level <style> tag per component",
"loc": { "start": {
"line": 9, "line": 9,
"column": 0 "column": 0,
"character": 58
}, },
"pos": 58 "pos": 58
} }

@ -1,9 +1,10 @@
{ {
"code": "invalid-directive-value", "code": "invalid-directive-value",
"message": "ref directives cannot have a value", "message": "ref directives cannot have a value",
"loc": { "start": {
"line": 1, "line": 1,
"column": 14 "column": 14,
"character": 14
}, },
"pos": 14 "pos": 14
} }

@ -1,9 +1,10 @@
{ {
"code": "unclosed-script", "code": "unclosed-script",
"message": "<script> must have a closing tag", "message": "<script> must have a closing tag",
"loc": { "start": {
"line": 3, "line": 3,
"column": 8 "column": 8,
"character": 32
}, },
"pos": 32 "pos": 32
} }

@ -1,9 +1,10 @@
{ {
"code": "invalid-self-placement", "code": "invalid-self-placement",
"message": "<svelte:self> components can only exist inside if-blocks or each-blocks", "message": "<svelte:self> components can only exist inside if-blocks or each-blocks",
"loc": { "start": {
"line": 1, "line": 1,
"column": 1 "column": 1,
"character": 1
}, },
"pos": 1 "pos": 1
} }

@ -1,9 +1,10 @@
{ {
"code": "unexpected-eof", "code": "unexpected-eof",
"message": "Unexpected end of input", "message": "Unexpected end of input",
"loc": { "start": {
"line": 1, "line": 1,
"column": 2 "column": 2,
"character": 2
}, },
"pos": 2 "pos": 2
} }

@ -1,9 +1,10 @@
{ {
"code": "unexpected-eof", "code": "unexpected-eof",
"message": "Unexpected end of input", "message": "Unexpected end of input",
"loc": { "start": {
"line": 1, "line": 1,
"column": 1 "column": 1,
"character": 1
}, },
"pos": 1 "pos": 1
} }

@ -1,9 +1,10 @@
{ {
"code": "unclosed-block", "code": "unclosed-block",
"message": "Block was left open", "message": "Block was left open",
"loc": { "start": {
"line": 1, "line": 1,
"column": 0 "column": 0,
"character": 0
}, },
"pos": 0 "pos": 0
} }

@ -1,9 +1,10 @@
{ {
"code": "unclosed-element", "code": "unclosed-element",
"message": "<div> was left open", "message": "<div> was left open",
"loc": { "start": {
"line": 1, "line": 1,
"column": 0 "column": 0,
"character": 0
}, },
"pos": 0 "pos": 0
} }

@ -1,9 +1,10 @@
{ {
"code": "invalid-closing-tag", "code": "invalid-closing-tag",
"message": "</div> attempted to close an element that was not open", "message": "</div> attempted to close an element that was not open",
"loc": { "start": {
"line": 1, "line": 1,
"column": 0 "column": 0,
"character": 0
}, },
"pos": 0 "pos": 0
} }

@ -1,9 +1,10 @@
{ {
"code": "invalid-void-content", "code": "invalid-void-content",
"message": "<input> is a void element and cannot have children, or a closing tag", "message": "<input> is a void element and cannot have children, or a closing tag",
"loc": { "start": {
"line": 1, "line": 1,
"column": 23 "column": 23,
"character": 23
}, },
"pos": 23 "pos": 23
} }

@ -1,9 +1,10 @@
{ {
"code": "invalid-window-content", "code": "invalid-window-content",
"message": "<svelte:window> cannot have children", "message": "<svelte:window> cannot have children",
"loc": { "start": {
"line": 1, "line": 1,
"column": 15 "column": 15,
"character": 15
}, },
"pos": 15 "pos": 15
} }

@ -1,9 +1,10 @@
{ {
"code": "duplicate-window", "code": "duplicate-window",
"message": "A component can only have one <svelte:window> tag", "message": "A component can only have one <svelte:window> tag",
"loc": { "start": {
"line": 2, "line": 2,
"column": 0 "column": 0,
"character": 17
}, },
"pos": 17 "pos": 17
} }

@ -1,9 +1,10 @@
{ {
"code": "invalid-window-placement", "code": "invalid-window-placement",
"message": "<svelte:window> tags cannot be inside elements or blocks", "message": "<svelte:window> tags cannot be inside elements or blocks",
"loc": { "start": {
"line": 2, "line": 2,
"column": 1 "column": 1,
"character": 11
}, },
"pos": 11 "pos": 11
} }

@ -1,9 +1,10 @@
{ {
"code": "invalid-window-placement", "code": "invalid-window-placement",
"message": "<svelte:window> tags cannot be inside elements or blocks", "message": "<svelte:window> tags cannot be inside elements or blocks",
"loc": { "start": {
"line": 2, "line": 2,
"column": 1 "column": 1,
"character": 7
}, },
"pos": 7 "pos": 7
} }

@ -1,14 +1,14 @@
export function test ({ assert, smc, locateInSource, locateInGenerated }) { export function test ({ assert, smc, locateInSource, locateInGenerated }) {
const expected = locateInSource( 'foo.bar.baz' ); const expected = locateInSource( 'foo.bar.baz' );
let loc; let start;
let actual; let actual;
loc = locateInGenerated( 'foo.bar.baz' ); start = locateInGenerated( 'foo.bar.baz' );
actual = smc.originalPositionFor({ actual = smc.originalPositionFor({
line: loc.line + 1, line: start.line + 1,
column: loc.column column: start.column
}); });
assert.deepEqual( actual, { assert.deepEqual( actual, {
@ -18,11 +18,11 @@ export function test ({ assert, smc, locateInSource, locateInGenerated }) {
column: expected.column column: expected.column
}); });
loc = locateInGenerated( 'foo.bar.baz', loc.character + 1 ); start = locateInGenerated( 'foo.bar.baz', start.character + 1 );
actual = smc.originalPositionFor({ actual = smc.originalPositionFor({
line: loc.line + 1, line: start.line + 1,
column: loc.column column: start.column
}); });
assert.deepEqual( actual, { assert.deepEqual( actual, {

@ -1,15 +1,15 @@
export function test ({ assert, smc, locateInSource, locateInGenerated }) { export function test ({ assert, smc, locateInSource, locateInGenerated }) {
const expected = locateInSource( 'potato' ); const expected = locateInSource( 'potato' );
let loc; let start;
loc = locateInGenerated( 'potato' ); start = locateInGenerated( 'potato' );
loc = locateInGenerated( 'potato', loc.character + 1 ); start = locateInGenerated( 'potato', start.character + 1 );
loc = locateInGenerated( 'potato', loc.character + 1 ); // we need the third instance of 'potato' start = locateInGenerated( 'potato', start.character + 1 ); // we need the third instance of 'potato'
const actual = smc.originalPositionFor({ const actual = smc.originalPositionFor({
line: loc.line + 1, line: start.line + 1,
column: loc.column column: start.column
}); });
assert.deepEqual( actual, { assert.deepEqual( actual, {

@ -1,14 +1,14 @@
export function test ({ assert, smc, locateInSource, locateInGenerated }) { export function test ({ assert, smc, locateInSource, locateInGenerated }) {
const expected = locateInSource( 'bar.baz' ); const expected = locateInSource( 'bar.baz' );
let loc; let start;
let actual; let actual;
loc = locateInGenerated( 'bar.baz' ); start = locateInGenerated( 'bar.baz' );
actual = smc.originalPositionFor({ actual = smc.originalPositionFor({
line: loc.line + 1, line: start.line + 1,
column: loc.column column: start.column
}); });
assert.deepEqual( actual, { assert.deepEqual( actual, {
@ -18,11 +18,11 @@ export function test ({ assert, smc, locateInSource, locateInGenerated }) {
column: expected.column column: expected.column
}); });
loc = locateInGenerated( 'bar.baz', loc.character + 1 ); start = locateInGenerated( 'bar.baz', start.character + 1 );
actual = smc.originalPositionFor({ actual = smc.originalPositionFor({
line: loc.line + 1, line: start.line + 1,
column: loc.column column: start.column
}); });
assert.deepEqual( actual, { assert.deepEqual( actual, {

@ -1,11 +1,11 @@
export function test ({ assert, smcCss, locateInSource, locateInGeneratedCss }) { export function test ({ assert, smcCss, locateInSource, locateInGeneratedCss }) {
const expected = locateInSource( '.foo' ); const expected = locateInSource( '.foo' );
const loc = locateInGeneratedCss( '.foo' ); const start = locateInGeneratedCss( '.foo' );
const actual = smcCss.originalPositionFor({ const actual = smcCss.originalPositionFor({
line: loc.line + 1, line: start.line + 1,
column: loc.column column: start.column
}); });
assert.deepEqual( actual, { assert.deepEqual( actual, {

@ -2,11 +2,11 @@ export function test({ assert, code, smc, locateInSource, locateInGenerated }) {
const startIndex = code.indexOf('create_main_fragment'); const startIndex = code.indexOf('create_main_fragment');
const expected = locateInSource('each'); const expected = locateInSource('each');
const loc = locateInGenerated('length', startIndex ); const start = locateInGenerated('length', startIndex );
const actual = smc.originalPositionFor({ const actual = smc.originalPositionFor({
line: loc.line + 1, line: start.line + 1,
column: loc.column column: start.column
}); });
assert.deepEqual( actual, { assert.deepEqual( actual, {

@ -1,10 +1,10 @@
export function test ({ assert, smc, locateInSource, locateInGenerated }) { export function test ({ assert, smc, locateInSource, locateInGenerated }) {
const expected = locateInSource( '42' ); const expected = locateInSource( '42' );
const loc = locateInGenerated( '42' ); const start = locateInGenerated( '42' );
const actual = smc.originalPositionFor({ const actual = smc.originalPositionFor({
line: loc.line + 1, line: start.line + 1,
column: loc.column column: start.column
}); });
assert.deepEqual( actual, { assert.deepEqual( actual, {

@ -50,7 +50,7 @@ describe('stats', () => {
} }
assert.equal(error.message, expectedError.message); assert.equal(error.message, expectedError.message);
assert.deepEqual(error.loc, expectedError.loc); assert.deepEqual(error.start, expectedError.start);
assert.deepEqual(error.end, expectedError.end); assert.deepEqual(error.end, expectedError.end);
assert.equal(error.pos, expectedError.pos); assert.equal(error.pos, expectedError.pos);
} }

@ -28,8 +28,8 @@ describe("validate", () => {
const { stats } = svelte.compile(input, { const { stats } = svelte.compile(input, {
onwarn(warning) { onwarn(warning) {
const { code, message, pos, loc, end } = warning; const { code, message, pos, start, end } = warning;
warnings.push({ code, message, pos, loc, end }); warnings.push({ code, message, pos, start, end });
}, },
dev: config.dev, dev: config.dev,
generate: false generate: false
@ -42,7 +42,7 @@ describe("validate", () => {
code: full.code, code: full.code,
message: full.message, message: full.message,
pos: full.pos, pos: full.pos,
loc: full.loc, start: full.start,
end: full.end end: full.end
}, lite); }, lite);
}); });
@ -65,7 +65,7 @@ describe("validate", () => {
assert.equal(error.code, expected.code); assert.equal(error.code, expected.code);
assert.equal(error.message, expected.message); assert.equal(error.message, expected.message);
assert.deepEqual(error.loc, expected.loc); assert.deepEqual(error.start, expected.start);
assert.deepEqual(error.end, expected.end); assert.deepEqual(error.end, expected.end);
assert.equal(error.pos, expected.pos); assert.equal(error.pos, expected.pos);
} }
@ -90,7 +90,7 @@ describe("validate", () => {
code: warning.code, code: warning.code,
message: warning.message, message: warning.message,
pos: warning.pos, pos: warning.pos,
loc: warning.loc start: warning.start
}); });
}, },
generate: false generate: false
@ -100,7 +100,7 @@ describe("validate", () => {
code: `options-lowercase-name`, code: `options-lowercase-name`,
message: "options.name should be capitalised", message: "options.name should be capitalised",
pos: undefined, pos: undefined,
loc: undefined start: undefined
} }
]); ]);
}); });
@ -114,7 +114,7 @@ describe("validate", () => {
code: warning.code, code: warning.code,
message: warning.message, message: warning.message,
pos: warning.pos, pos: warning.pos,
loc: warning.loc start: warning.start
}); });
}, },
generate: false generate: false

@ -2,13 +2,15 @@
{ {
"code": "a11y-missing-attribute", "code": "a11y-missing-attribute",
"message": "A11y: <img> element should have an alt attribute", "message": "A11y: <img> element should have an alt attribute",
"loc": { "start": {
"line": 1, "line": 1,
"column": 0 "column": 0,
"character": 0
}, },
"end": { "end": {
"line": 1, "line": 1,
"column": 19 "column": 19,
"character": 19
}, },
"pos": 0 "pos": 0
}, },
@ -16,13 +18,15 @@
{ {
"code": "a11y-missing-attribute", "code": "a11y-missing-attribute",
"message": "A11y: <area> element should have an alt, aria-label or aria-labelledby attribute", "message": "A11y: <area> element should have an alt, aria-label or aria-labelledby attribute",
"loc": { "start": {
"line": 4, "line": 4,
"column": 1 "column": 1,
"character": 28
}, },
"end": { "end": {
"line": 4, "line": 4,
"column": 7 "column": 7,
"character": 34
}, },
"pos": 28 "pos": 28
}, },
@ -30,13 +34,15 @@
{ {
"code": "a11y-missing-attribute", "code": "a11y-missing-attribute",
"message": "A11y: <object> element should have a title, aria-label or aria-labelledby attribute", "message": "A11y: <object> element should have a title, aria-label or aria-labelledby attribute",
"loc": { "start": {
"line": 7, "line": 7,
"column": 0 "column": 0,
"character": 43
}, },
"end": { "end": {
"line": 7, "line": 7,
"column": 17 "column": 17,
"character": 60
}, },
"pos": 43 "pos": 43
}, },
@ -44,13 +50,15 @@
{ {
"code": "a11y-missing-attribute", "code": "a11y-missing-attribute",
"message": "A11y: <input type=\"image\"> element should have an alt, aria-label or aria-labelledby attribute", "message": "A11y: <input type=\"image\"> element should have an alt, aria-label or aria-labelledby attribute",
"loc": { "start": {
"line": 9, "line": 9,
"column": 0 "column": 0,
"character": 62
}, },
"end": { "end": {
"line": 9, "line": 9,
"column": 20 "column": 20,
"character": 82
}, },
"pos": 62 "pos": 62
} }

@ -1,13 +1,15 @@
[{ [{
"code": "a11y-missing-content", "code": "a11y-missing-content",
"message": "A11y: <a> element should have child content", "message": "A11y: <a> element should have child content",
"loc": { "start": {
"line": 1, "line": 1,
"column": 0 "column": 0,
"character": 0
}, },
"end": { "end": {
"line": 1, "line": 1,
"column": 19 "column": 19,
"character": 19
}, },
"pos": 0 "pos": 0
}] }]

@ -2,39 +2,45 @@
{ {
"code": "a11y-missing-attribute", "code": "a11y-missing-attribute",
"message": "A11y: <a> element should have an href attribute", "message": "A11y: <a> element should have an href attribute",
"loc": { "start": {
"line": 1, "line": 1,
"column": 11 "column": 11,
"character": 11
}, },
"end": { "end": {
"line": 1, "line": 1,
"column": 37 "column": 37,
"character": 37
}, },
"pos": 11 "pos": 11
}, },
{ {
"code": "a11y-invalid-attribute", "code": "a11y-invalid-attribute",
"message": "A11y: '' is not a valid xlink:href attribute", "message": "A11y: '' is not a valid xlink:href attribute",
"loc": { "start": {
"line": 2, "line": 2,
"column": 14 "column": 14,
"character": 65
}, },
"end": { "end": {
"line": 2, "line": 2,
"column": 27 "column": 27,
"character": 78
}, },
"pos": 65 "pos": 65
}, },
{ {
"code": "a11y-invalid-attribute", "code": "a11y-invalid-attribute",
"message": "A11y: '#' is not a valid xlink:href attribute", "message": "A11y: '#' is not a valid xlink:href attribute",
"loc": { "start": {
"line": 3, "line": 3,
"column": 14 "column": 14,
"character": 130
}, },
"end": { "end": {
"line": 3, "line": 3,
"column": 28 "column": 28,
"character": 144
}, },
"pos": 130 "pos": 130
} }

@ -2,39 +2,45 @@
{ {
"code": "a11y-missing-attribute", "code": "a11y-missing-attribute",
"message": "A11y: <a> element should have an href attribute", "message": "A11y: <a> element should have an href attribute",
"loc": { "start": {
"line": 1, "line": 1,
"column": 0 "column": 0,
"character": 0
}, },
"end": { "end": {
"line": 1, "line": 1,
"column": 26 "column": 26,
"character": 26
}, },
"pos": 0 "pos": 0
}, },
{ {
"code": "a11y-invalid-attribute", "code": "a11y-invalid-attribute",
"message": "A11y: '' is not a valid href attribute", "message": "A11y: '' is not a valid href attribute",
"loc": { "start": {
"line": 2, "line": 2,
"column": 3 "column": 3,
"character": 30
}, },
"end": { "end": {
"line": 2, "line": 2,
"column": 10 "column": 10,
"character": 37
}, },
"pos": 30 "pos": 30
}, },
{ {
"code": "a11y-invalid-attribute", "code": "a11y-invalid-attribute",
"message": "A11y: '#' is not a valid href attribute", "message": "A11y: '#' is not a valid href attribute",
"loc": { "start": {
"line": 3, "line": 3,
"column": 3 "column": 3,
"character": 53
}, },
"end": { "end": {
"line": 3, "line": 3,
"column": 11 "column": 11,
"character": 61
}, },
"pos": 53 "pos": 53
} }

@ -2,13 +2,15 @@
{ {
"code": "a11y-unknown-aria-attribute", "code": "a11y-unknown-aria-attribute",
"message": "A11y: Unknown aria attribute 'aria-labeledby' (did you mean 'labelledby'?)", "message": "A11y: Unknown aria attribute 'aria-labeledby' (did you mean 'labelledby'?)",
"loc": { "start": {
"line": 1, "line": 1,
"column": 20 "column": 20,
"character": 20
}, },
"end": { "end": {
"line": 1, "line": 1,
"column": 40 "column": 40,
"character": 40
}, },
"pos": 20 "pos": 20
}, },
@ -16,13 +18,15 @@
{ {
"code": "a11y-missing-attribute", "code": "a11y-missing-attribute",
"message": "A11y: <input type=\"image\"> element should have an alt, aria-label or aria-labelledby attribute", "message": "A11y: <input type=\"image\"> element should have an alt, aria-label or aria-labelledby attribute",
"loc": { "start": {
"column": 0, "column": 0,
"line": 1 "line": 1,
"character": 0
}, },
"end": { "end": {
"line": 1, "line": 1,
"column": 41 "column": 41,
"character": 41
}, },
"pos": 0 "pos": 0
} }

@ -2,13 +2,15 @@
{ {
"code": "a11y-unknown-role", "code": "a11y-unknown-role",
"message": "A11y: Unknown role 'toooltip' (did you mean 'tooltip'?)", "message": "A11y: Unknown role 'toooltip' (did you mean 'tooltip'?)",
"loc": { "start": {
"line": 1, "line": 1,
"column": 5 "column": 5,
"character": 5
}, },
"end": { "end": {
"line": 1, "line": 1,
"column": 20 "column": 20,
"character": 20
}, },
"pos": 5 "pos": 5
} }

@ -2,13 +2,15 @@
{ {
"code": "a11y-aria-attributes", "code": "a11y-aria-attributes",
"message": "A11y: <meta> should not have aria-* attributes", "message": "A11y: <meta> should not have aria-* attributes",
"loc": { "start": {
"line": 1, "line": 1,
"column": 6 "column": 6,
"character": 6
}, },
"end": { "end": {
"line": 1, "line": 1,
"column": 25 "column": 25,
"character": 25
}, },
"pos": 6 "pos": 6
}, },
@ -16,13 +18,15 @@
{ {
"code": "a11y-misplaced-role", "code": "a11y-misplaced-role",
"message": "A11y: <meta> should not have role attribute", "message": "A11y: <meta> should not have role attribute",
"loc": { "start": {
"line": 2, "line": 2,
"column": 6 "column": 6,
"character": 33
}, },
"end": { "end": {
"line": 2, "line": 2,
"column": 20 "column": 20,
"character": 47
}, },
"pos": 33 "pos": 33
} }

@ -2,26 +2,30 @@
{ {
"code": "a11y-structure", "code": "a11y-structure",
"message": "A11y: <figcaption> must be first or last child of <figure>", "message": "A11y: <figcaption> must be first or last child of <figure>",
"loc": { "start": {
"line": 4, "line": 4,
"column": 1 "column": 1,
"character": 57
}, },
"end": { "end": {
"line": 6, "line": 6,
"column": 14 "column": 14,
"character": 115
}, },
"pos": 57 "pos": 57
}, },
{ {
"code": "a11y-structure", "code": "a11y-structure",
"message": "A11y: <figcaption> must be an immediate child of <figure>", "message": "A11y: <figcaption> must be an immediate child of <figure>",
"loc": { "start": {
"line": 15, "line": 15,
"column": 2 "column": 2,
"character": 252
}, },
"end": { "end": {
"line": 17, "line": 17,
"column": 15 "column": 15,
"character": 328
}, },
"pos": 252 "pos": 252
} }

@ -2,13 +2,15 @@
{ {
"code": "a11y-missing-content", "code": "a11y-missing-content",
"message": "A11y: <h1> element should have child content", "message": "A11y: <h1> element should have child content",
"loc": { "start": {
"line": 1, "line": 1,
"column": 0 "column": 0,
"character": 0
}, },
"end": { "end": {
"line": 1, "line": 1,
"column": 9 "column": 9,
"character": 9
}, },
"pos": 0 "pos": 0
}, },
@ -16,13 +18,15 @@
{ {
"code": "a11y-hidden", "code": "a11y-hidden",
"message": "A11y: <h2> element should not be hidden", "message": "A11y: <h2> element should not be hidden",
"loc": { "start": {
"line": 2, "line": 2,
"column": 4 "column": 4,
"character": 14
}, },
"end": { "end": {
"line": 2, "line": 2,
"column": 15 "column": 15,
"character": 25
}, },
"pos": 14 "pos": 14
} }

@ -2,13 +2,15 @@
{ {
"code": "a11y-missing-attribute", "code": "a11y-missing-attribute",
"message": "A11y: <html> element should have a lang attribute", "message": "A11y: <html> element should have a lang attribute",
"loc": { "start": {
"column": 0, "column": 0,
"line": 5 "line": 5,
"character": 82
}, },
"end": { "end": {
"line": 5, "line": 5,
"column": 13 "column": 13,
"character": 95
}, },
"pos": 82 "pos": 82
} }

@ -2,13 +2,15 @@
{ {
"code": "a11y-missing-attribute", "code": "a11y-missing-attribute",
"message": "A11y: <iframe> element should have a title attribute", "message": "A11y: <iframe> element should have a title attribute",
"loc": { "start": {
"line": 1, "line": 1,
"column": 0 "column": 0,
"character": 0
}, },
"end": { "end": {
"line": 1, "line": 1,
"column": 29 "column": 29,
"character": 29
}, },
"pos": 0 "pos": 0
} }

@ -1,13 +1,15 @@
[{ [{
"code": "a11y-accesskey", "code": "a11y-accesskey",
"message": "A11y: Avoid using accesskey", "message": "A11y: Avoid using accesskey",
"loc": { "start": {
"line": 1, "line": 1,
"column": 5 "column": 5,
"character": 5
}, },
"end": { "end": {
"line": 1, "line": 1,
"column": 18 "column": 18,
"character": 18
}, },
"pos": 5 "pos": 5
}] }]

@ -1,13 +1,15 @@
[{ [{
"code": "a11y-autofocus", "code": "a11y-autofocus",
"message": "A11y: Avoid using autofocus", "message": "A11y: Avoid using autofocus",
"loc": { "start": {
"line": 1, "line": 1,
"column": 5 "column": 5,
"character": 5
}, },
"end": { "end": {
"line": 1, "line": 1,
"column": 14 "column": 14,
"character": 14
}, },
"pos": 5 "pos": 5
}] }]

@ -2,13 +2,15 @@
{ {
"code": "a11y-distracting-elements", "code": "a11y-distracting-elements",
"message": "A11y: Avoid <marquee> elements", "message": "A11y: Avoid <marquee> elements",
"loc": { "start": {
"line": 1, "line": 1,
"column": 0 "column": 0,
"character": 0
}, },
"end": { "end": {
"line": 1, "line": 1,
"column": 10 "column": 10,
"character": 10
}, },
"pos": 0 "pos": 0
}, },
@ -16,13 +18,15 @@
{ {
"code": "a11y-distracting-elements", "code": "a11y-distracting-elements",
"message": "A11y: Avoid <blink> elements", "message": "A11y: Avoid <blink> elements",
"loc": { "start": {
"line": 2, "line": 2,
"column": 0 "column": 0,
"character": 11
}, },
"end": { "end": {
"line": 2, "line": 2,
"column": 8 "column": 8,
"character": 19
}, },
"pos": 11 "pos": 11
} }

@ -2,13 +2,15 @@
{ {
"code": "a11y-autofocus", "code": "a11y-autofocus",
"message": "A11y: Avoid using autofocus", "message": "A11y: Avoid using autofocus",
"loc": { "start": {
"column": 8, "column": 8,
"line": 2 "line": 2,
"character": 29
}, },
"end": { "end": {
"line": 2, "line": 2,
"column": 17 "column": 17,
"character": 38
}, },
"pos": 29 "pos": 29
} }

@ -2,13 +2,15 @@
{ {
"code": "a11y-misplaced-scope", "code": "a11y-misplaced-scope",
"message": "A11y: The scope attribute should only be used with <th> elements", "message": "A11y: The scope attribute should only be used with <th> elements",
"loc": { "start": {
"line": 1, "line": 1,
"column": 5 "column": 5,
"character": 5
}, },
"end": { "end": {
"line": 1, "line": 1,
"column": 10 "column": 10,
"character": 10
}, },
"pos": 5 "pos": 5
} }

@ -2,13 +2,15 @@
{ {
"code": "a11y-positive-tabindex", "code": "a11y-positive-tabindex",
"message": "A11y: avoid tabindex values above zero", "message": "A11y: avoid tabindex values above zero",
"loc": { "start": {
"line": 3, "line": 3,
"column": 5 "column": 5,
"character": 46
}, },
"end": { "end": {
"line": 3, "line": 3,
"column": 17 "column": 17,
"character": 58
}, },
"pos": 46 "pos": 46
} }

@ -2,12 +2,14 @@
"code": "missing-action", "code": "missing-action",
"message": "Missing action 'whatever'", "message": "Missing action 'whatever'",
"pos": 5, "pos": 5,
"loc": { "start": {
"line": 1, "line": 1,
"column": 5 "column": 5,
"character": 5
}, },
"end": { "end": {
"line": 1, "line": 1,
"column": 17 "column": 17,
"character": 17
} }
}] }]

@ -2,12 +2,14 @@
"code": "invalid-action", "code": "invalid-action",
"message": "Actions can only be applied to DOM elements, not components", "message": "Actions can only be applied to DOM elements, not components",
"pos": 8, "pos": 8,
"loc": { "start": {
"line": 1, "line": 1,
"column": 8 "column": 8,
"character": 8
}, },
"end": { "end": {
"line": 1, "line": 1,
"column": 15 "column": 15,
"character": 15
} }
}] }]

@ -1,13 +1,15 @@
[{ [{
"code": "invalid-binding", "code": "invalid-binding",
"message": "'checked' binding can only be used with <input type=\"checkbox\">", "message": "'checked' binding can only be used with <input type=\"checkbox\">",
"loc": { "start": {
"line": 1, "line": 1,
"column": 7 "column": 7,
"character": 7
}, },
"end": { "end": {
"line": 1, "line": 1,
"column": 25 "column": 25,
"character": 25
}, },
"pos": 7 "pos": 7
}] }]

@ -1,13 +1,15 @@
[{ [{
"code": "missing-type", "code": "missing-type",
"message": "'type' attribute must be specified", "message": "'type' attribute must be specified",
"loc": { "start": {
"line": 1, "line": 1,
"column": 24 "column": 24,
"character": 24
}, },
"end": { "end": {
"line": 1, "line": 1,
"column": 28 "column": 28,
"character": 28
}, },
"pos": 24 "pos": 24
}] }]

@ -1,13 +1,15 @@
[{ [{
"code": "invalid-type", "code": "invalid-type",
"message": "'type' attribute cannot be dynamic if input uses two-way binding", "message": "'type' attribute cannot be dynamic if input uses two-way binding",
"loc": { "start": {
"line": 1, "line": 1,
"column": 24 "column": 24,
"character": 24
}, },
"end": { "end": {
"line": 1, "line": 1,
"column": 42 "column": 42,
"character": 42
}, },
"pos": 24 "pos": 24
}] }]

@ -2,12 +2,14 @@
"code": "invalid-binding", "code": "invalid-binding",
"message": "'value' is not a valid binding on <div> elements", "message": "'value' is not a valid binding on <div> elements",
"pos": 5, "pos": 5,
"loc": { "start": {
"line": 1, "line": 1,
"column": 5 "column": 5,
"character": 5
}, },
"end": { "end": {
"line": 1, "line": 1,
"column": 15 "column": 15,
"character": 15
} }
}] }]

@ -2,12 +2,14 @@
"code": "invalid-binding", "code": "invalid-binding",
"message": "'whatever' is not a valid binding", "message": "'whatever' is not a valid binding",
"pos": 5, "pos": 5,
"loc": { "start": {
"line": 1, "line": 1,
"column": 5 "column": 5,
"character": 5
}, },
"end": { "end": {
"line": 1, "line": 1,
"column": 18 "column": 18,
"character": 18
} }
}] }]

@ -1,13 +1,15 @@
[{ [{
"code": "dynamic-multiple-attribute", "code": "dynamic-multiple-attribute",
"message": "'multiple' attribute cannot be dynamic if select uses two-way binding", "message": "'multiple' attribute cannot be dynamic if select uses two-way binding",
"loc": { "start": {
"line": 1, "line": 1,
"column": 19 "column": 19,
"character": 19
}, },
"end": { "end": {
"line": 1, "line": 1,
"column": 29 "column": 29,
"character": 29
}, },
"pos": 19 "pos": 19
}] }]

@ -2,12 +2,14 @@
"code": "invalid-name", "code": "invalid-name",
"message": "Component constructors cannot be called 'state' due to technical limitations", "message": "Component constructors cannot be called 'state' due to technical limitations",
"pos": 73, "pos": 73,
"loc": { "start": {
"line": 6, "line": 6,
"column": 3 "column": 3,
"character": 73
}, },
"end": { "end": {
"line": 6, "line": 6,
"column": 8 "column": 8,
"character": 78
} }
}] }]

@ -1,6 +1,6 @@
[{ [{
"message": "duplicate default <slot> element", "message": "duplicate default <slot> element",
"loc": { "start": {
"line": 2, "line": 2,
"column": 0 "column": 0
}, },

@ -1,13 +1,15 @@
[{ [{
"code": "invalid-slot-name", "code": "invalid-slot-name",
"message": "default is a reserved word — it cannot be used as a slot name", "message": "default is a reserved word — it cannot be used as a slot name",
"loc": { "start": {
"line": 1, "line": 1,
"column": 6 "column": 6,
"character": 6
}, },
"end": { "end": {
"line": 1, "line": 1,
"column": 20 "column": 20,
"character": 20
}, },
"pos": 6 "pos": 6
}] }]

@ -1,13 +1,15 @@
[{ [{
"code": "invalid-slot-attribute", "code": "invalid-slot-attribute",
"message": "slot attribute cannot have a dynamic value", "message": "slot attribute cannot have a dynamic value",
"loc": { "start": {
"line": 2, "line": 2,
"column": 9 "column": 9,
"character": 18
}, },
"end": { "end": {
"line": 2, "line": 2,
"column": 21 "column": 21,
"character": 30
}, },
"pos": 18 "pos": 18
}] }]

@ -1,13 +1,15 @@
[{ [{
"code": "dynamic-slot-name", "code": "dynamic-slot-name",
"message": "<slot> name cannot be dynamic", "message": "<slot> name cannot be dynamic",
"loc": { "start": {
"line": 1, "line": 1,
"column": 6 "column": 6,
"character": 6
}, },
"end": { "end": {
"line": 1, "line": 1,
"column": 18 "column": 18,
"character": 18
}, },
"pos": 6 "pos": 6
}] }]

@ -1,13 +1,15 @@
[{ [{
"code": "invalid-slot-placement", "code": "invalid-slot-placement",
"message": "<slot> cannot be a child of an each-block", "message": "<slot> cannot be a child of an each-block",
"loc": { "start": {
"line": 2, "line": 2,
"column": 1 "column": 1,
"character": 25
}, },
"end": { "end": {
"line": 2, "line": 2,
"column": 1 "column": 1,
"character": 25
}, },
"pos": 25 "pos": 25
}] }]

@ -1,6 +1,6 @@
[{ [{
"message": "duplicate 'foo' <slot> element", "message": "duplicate 'foo' <slot> element",
"loc": { "start": {
"line": 2, "line": 2,
"column": 6 "column": 6
}, },

@ -1,13 +1,15 @@
[{ [{
"code": "invalid-slotted-content", "code": "invalid-slotted-content",
"message": "Cannot place slotted elements inside an each-block", "message": "Cannot place slotted elements inside an each-block",
"loc": { "start": {
"line": 3, "line": 3,
"column": 7 "column": 7,
"character": 41
}, },
"end": { "end": {
"line": 3, "line": 3,
"column": 17 "column": 17,
"character": 51
}, },
"pos": 41 "pos": 41
}] }]

@ -1,13 +1,15 @@
[{ [{
"code": "invalid-slotted-content", "code": "invalid-slotted-content",
"message": "Cannot place slotted elements inside an if-block", "message": "Cannot place slotted elements inside an if-block",
"loc": { "start": {
"line": 3, "line": 3,
"column": 7 "column": 7,
"character": 29
}, },
"end": { "end": {
"line": 3, "line": 3,
"column": 17 "column": 17,
"character": 39
}, },
"pos": 29 "pos": 29
}] }]

@ -2,12 +2,14 @@
"code": "impure-computed", "code": "impure-computed",
"message": "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'?", "message": "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'?",
"pos": 81, "pos": 81,
"loc": { "start": {
"line": 7, "line": 7,
"column": 4 "column": 4,
"character": 81
}, },
"end": { "end": {
"line": 7, "line": 7,
"column": 8 "column": 8,
"character": 85
} }
}] }]

@ -2,12 +2,14 @@
"code": "impure-computed", "code": "impure-computed",
"message": "Cannot use this.get(...) — values must be passed into the function as arguments", "message": "Cannot use this.get(...) — values must be passed into the function as arguments",
"pos": 71, "pos": 71,
"loc": { "start": {
"line": 7, "line": 7,
"column": 11 "column": 11,
"character": 71
}, },
"end": { "end": {
"line": 7, "line": 7,
"column": 28 "column": 28,
"character": 88
} }
}] }]

@ -1,13 +1,15 @@
[{ [{
"code": "css-invalid-global", "code": "css-invalid-global",
"message": ":global(...) can be at the start or end of a selector sequence, but not in the middle", "message": ":global(...) can be at the start or end of a selector sequence, but not in the middle",
"loc": { "start": {
"line": 2, "line": 2,
"column": 6 "column": 6,
"character": 14
}, },
"end": { "end": {
"line": 2, "line": 2,
"column": 19 "column": 19,
"character": 27
}, },
"pos": 14 "pos": 14
}] }]

@ -1,13 +1,15 @@
[{ [{
"code": "css-invalid-global", "code": "css-invalid-global",
"message": ":global(...) must be the first element in a compound selector", "message": ":global(...) must be the first element in a compound selector",
"loc": { "start": {
"line": 2, "line": 2,
"column": 5 "column": 5,
"character": 13
}, },
"end": { "end": {
"line": 2, "line": 2,
"column": 18 "column": 18,
"character": 26
}, },
"pos": 13 "pos": 13
}] }]

@ -1,13 +1,15 @@
[{ [{
"code": "unexpected-reserved-word", "code": "unexpected-reserved-word",
"message": "'case' is a reserved word in JavaScript and cannot be used here", "message": "'case' is a reserved word in JavaScript and cannot be used here",
"loc": { "start": {
"line": 1, "line": 1,
"column": 17 "column": 17,
"character": 17
}, },
"end": { "end": {
"line": 1, "line": 1,
"column": 17 "column": 17,
"character": 17
}, },
"pos": 17 "pos": 17
}] }]

@ -1,13 +1,15 @@
[{ [{
"code": "unexpected-reserved-word", "code": "unexpected-reserved-word",
"message": "'case' is a reserved word in JavaScript and cannot be used here", "message": "'case' is a reserved word in JavaScript and cannot be used here",
"loc": { "start": {
"line": 1, "line": 1,
"column": 16 "column": 16,
"character": 16
}, },
"end": { "end": {
"line": 1, "line": 1,
"column": 16 "column": 16,
"character": 16
}, },
"pos": 16 "pos": 16
}] }]

@ -2,26 +2,30 @@
{ {
"code": "empty-block", "code": "empty-block",
"message": "Empty block", "message": "Empty block",
"loc": { "start": {
"line": 1, "line": 1,
"column": 0 "column": 0,
"character": 0
}, },
"end": { "end": {
"line": 3, "line": 3,
"column": 7 "column": 7,
"character": 32
}, },
"pos": 0 "pos": 0
}, },
{ {
"code": "empty-block", "code": "empty-block",
"message": "Empty block", "message": "Empty block",
"loc": { "start": {
"line": 5, "line": 5,
"column": 0 "column": 0,
"character": 34
}, },
"end": { "end": {
"line": 5, "line": 5,
"column": 30 "column": 30,
"character": 64
}, },
"pos": 34 "pos": 34
} }

@ -2,12 +2,14 @@
"code": "missing-ref", "code": "missing-ref",
"message": "'refs.inputx' does not exist (did you mean 'refs.input'?)", "message": "'refs.inputx' does not exist (did you mean 'refs.input'?)",
"pos": 36, "pos": 36,
"loc": { "start": {
"line": 2, "line": 2,
"column": 18 "column": 18,
"character": 36
}, },
"end": { "end": {
"line": 2, "line": 2,
"column": 35 "column": 35,
"character": 53
} }
}] }]

@ -2,12 +2,14 @@
"code": "parse-error", "code": "parse-error",
"message": "Duplicate export 'default'", "message": "Duplicate export 'default'",
"pos": 37, "pos": 37,
"loc": { "start": {
"line": 3, "line": 3,
"column": 8 "column": 8,
"character": 37
}, },
"end": { "end": {
"line": 3, "line": 3,
"column": 8 "column": 8,
"character": 37
} }
}] }]

@ -2,12 +2,14 @@
"code": "invalid-default-export", "code": "invalid-default-export",
"message": "Default export must be an object literal", "message": "Default export must be an object literal",
"pos": 25, "pos": 25,
"loc": { "start": {
"line": 2, "line": 2,
"column": 16 "column": 16,
"character": 25
}, },
"end": { "end": {
"line": 2, "line": 2,
"column": 22 "column": 22,
"character": 31
} }
}] }]

@ -1,13 +1,15 @@
[{ [{
"code": "each-context-clash", "code": "each-context-clash",
"message": "Context clashes with a helper. Rename one or the other to eliminate any ambiguity", "message": "Context clashes with a helper. Rename one or the other to eliminate any ambiguity",
"loc": { "start": {
"line": 1, "line": 1,
"column": 17 "column": 17,
"character": 17
}, },
"end": { "end": {
"line": 1, "line": 1,
"column": 22 "column": 22,
"character": 22
}, },
"pos": 17 "pos": 17
}] }]

@ -2,12 +2,14 @@
"code": "impure-helper", "code": "impure-helper",
"message": "Helpers should be pure functions, with at least one argument", "message": "Helpers should be pure functions, with at least one argument",
"pos": 52, "pos": 52,
"loc": { "start": {
"line": 6, "line": 6,
"column": 3 "column": 3,
"character": 52
}, },
"end": { "end": {
"line": 8, "line": 8,
"column": 4 "column": 4,
"character": 91
} }
}] }]

@ -2,12 +2,14 @@
"code": "impure-helper", "code": "impure-helper",
"message": "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'?", "message": "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'?",
"pos": 95, "pos": 95,
"loc": { "start": {
"line": 7, "line": 7,
"column": 4 "column": 4,
"character": 95
}, },
"end": { "end": {
"line": 7, "line": 7,
"column": 8 "column": 8,
"character": 99
} }
}] }]

@ -2,12 +2,14 @@
"code": "impure-helper", "code": "impure-helper",
"message": "Cannot use this.get(...) — values must be passed into the helper function as arguments", "message": "Cannot use this.get(...) — values must be passed into the helper function as arguments",
"pos": 72, "pos": 72,
"loc": { "start": {
"line": 7, "line": 7,
"column": 11 "column": 11,
"character": 72
}, },
"end": { "end": {
"line": 7, "line": 7,
"column": 28 "column": 28,
"character": 89
} }
}] }]

@ -2,12 +2,14 @@
"code": "invalid-method-value", "code": "invalid-method-value",
"message": "Method 'foo' should be a function expression, not an arrow function expression", "message": "Method 'foo' should be a function expression, not an arrow function expression",
"pos": 79, "pos": 79,
"loc": { "start": {
"line": 6, "line": 6,
"column": 3 "column": 3,
"character": 79
}, },
"end": { "end": {
"line": 8, "line": 8,
"column": 4 "column": 4,
"character": 120
} }
}] }]

@ -2,12 +2,14 @@
"code": "invalid-callee", "code": "invalid-callee",
"message": "'foo' is an invalid callee (should be one of this.*, event.*, options.*, console.*, store.*, set, fire, destroy or bar). 'foo' exists on 'helpers', did you put it in the wrong place?", "message": "'foo' is an invalid callee (should be one of this.*, event.*, options.*, console.*, store.*, set, fire, destroy or bar). 'foo' exists on 'helpers', did you put it in the wrong place?",
"pos": 18, "pos": 18,
"loc": { "start": {
"line": 1, "line": 1,
"column": 18 "column": 18,
"character": 18
}, },
"end": { "end": {
"line": 1, "line": 1,
"column": 23 "column": 23,
"character": 23
} }
}] }]

@ -2,12 +2,14 @@
"code": "invalid-callee", "code": "invalid-callee",
"message": "'foo' is an invalid callee (should be one of this.*, event.*, options.*, console.*, store.*, set, fire, destroy or bar)", "message": "'foo' is an invalid callee (should be one of this.*, event.*, options.*, console.*, store.*, set, fire, destroy or bar)",
"pos": 18, "pos": 18,
"loc": { "start": {
"line": 1, "line": 1,
"column": 18 "column": 18,
"character": 18
}, },
"end": { "end": {
"line": 1, "line": 1,
"column": 23 "column": 23,
"character": 23
} }
}] }]

@ -1,13 +1,15 @@
[{ [{
"code": "missing-component", "code": "missing-component",
"message": "Widget component is not defined", "message": "Widget component is not defined",
"loc": { "start": {
"line": 2, "line": 2,
"column": 1 "column": 1,
"character": 7
}, },
"end": { "end": {
"line": 2, "line": 2,
"column": 10 "column": 10,
"character": 16
}, },
"pos": 7 "pos": 7
}] }]

@ -2,12 +2,14 @@
"code": "named-export", "code": "named-export",
"message": "A component can only have a default export", "message": "A component can only have a default export",
"pos": 10, "pos": 10,
"loc": { "start": {
"line": 2, "line": 2,
"column": 1 "column": 1,
"character": 10
}, },
"end": { "end": {
"line": 2, "line": 2,
"column": 21 "column": 21,
"character": 30
} }
}] }]

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

Loading…
Cancel
Save