add codes to warnings (#474)

pull/1340/head
Rich Harris 7 years ago
parent 1c4b1665d1
commit f0b2cb99f2

@ -435,6 +435,7 @@ export default class Stylesheet {
const message = `Unused CSS selector`; const message = `Unused CSS selector`;
onwarn({ onwarn({
code: `css-unused-selector`,
message, message,
frame, frame,
loc: { line: line + 1, column }, loc: { line: line + 1, column },

@ -276,6 +276,7 @@ function getGlobals(dependencies: Dependency[], options: CompileOptions) {
onerror(error); onerror(error);
} else { } else {
const warning = { const warning = {
code: `options-missing-globals`,
message: `No name was supplied for imported module '${d.source}'. Guessing '${d.name}', but you should use options.globals`, message: `No name was supplied for imported module '${d.source}'. Guessing '${d.name}', but you should use options.globals`,
}; };

@ -31,6 +31,7 @@ export interface Warning {
loc?: { line: number; column: number; pos?: number }; loc?: { line: number; column: number; pos?: number };
end?: { line: number; column: number; }; end?: { line: number; column: number; };
pos?: number; pos?: number;
code: string;
message: string; message: string;
filename?: string; filename?: string;
frame?: string; frame?: string;

@ -35,7 +35,10 @@ export default function a11y(
if (name.startsWith('aria-')) { if (name.startsWith('aria-')) {
if (invisibleElements.has(node.name)) { if (invisibleElements.has(node.name)) {
// aria-unsupported-elements // aria-unsupported-elements
validator.warn(`A11y: <${node.name}> should not have aria-* attributes`, attribute); validator.warn(attribute, {
code: `a11y-aria-attributes`,
message: `A11y: <${node.name}> should not have aria-* attributes`
});
} }
const type = name.slice(5); const type = name.slice(5);
@ -44,7 +47,10 @@ export default function a11y(
let message = `A11y: Unknown aria attribute 'aria-${type}'`; let message = `A11y: Unknown aria attribute 'aria-${type}'`;
if (match) message += ` (did you mean '${match}'?)`; if (match) message += ` (did you mean '${match}'?)`;
validator.warn(message, attribute); validator.warn(attribute, {
code: `a11y-unknown-aria-attribute`,
message
});
} }
} }
@ -52,7 +58,10 @@ export default function a11y(
if (name === 'role') { if (name === 'role') {
if (invisibleElements.has(node.name)) { if (invisibleElements.has(node.name)) {
// aria-unsupported-elements // aria-unsupported-elements
validator.warn(`A11y: <${node.name}> should not have role attribute`, attribute); validator.warn(attribute, {
code: `a11y-misplaced-role`,
message: `A11y: <${node.name}> should not have role attribute`
});
} }
const value = getStaticAttributeValue(node, 'role'); const value = getStaticAttributeValue(node, 'role');
@ -61,30 +70,45 @@ export default function a11y(
let message = `A11y: Unknown role '${value}'`; let message = `A11y: Unknown role '${value}'`;
if (match) message += ` (did you mean '${match}'?)`; if (match) message += ` (did you mean '${match}'?)`;
validator.warn(message, attribute); validator.warn(attribute, {
code: `a11y-unknown-role`,
message
});
} }
} }
// no-access-key // no-access-key
if (name === 'accesskey') { if (name === 'accesskey') {
validator.warn(`A11y: Avoid using accesskey`, attribute); validator.warn(attribute, {
code: `a11y-accesskey`,
message: `A11y: Avoid using accesskey`
});
} }
// no-autofocus // no-autofocus
if (name === 'autofocus') { if (name === 'autofocus') {
validator.warn(`A11y: Avoid using autofocus`, attribute); validator.warn(attribute, {
code: `a11y-autofocus`,
message: `A11y: Avoid using autofocus`
});
} }
// scope // scope
if (name === 'scope' && node.name !== 'th') { if (name === 'scope' && node.name !== 'th') {
validator.warn(`A11y: The scope attribute should only be used with <th> elements`, attribute); validator.warn(attribute, {
code: `a11y-misplaced-scope`,
message: `A11y: The scope attribute should only be used with <th> elements`
});
} }
// tabindex-no-positive // tabindex-no-positive
if (name === 'tabindex') { if (name === 'tabindex') {
const value = getStaticAttributeValue(node, 'tabindex'); const value = getStaticAttributeValue(node, 'tabindex');
if (!isNaN(value) && +value > 0) { if (!isNaN(value) && +value > 0) {
validator.warn(`A11y: avoid tabindex values above zero`, attribute); validator.warn(attribute, {
code: `a11y-positive-tabindex`,
message: `A11y: avoid tabindex values above zero`
});
} }
} }
@ -98,13 +122,19 @@ export default function a11y(
attributes.slice(0, -1).join(', ') + ` or ${attributes[attributes.length - 1]}` : attributes.slice(0, -1).join(', ') + ` or ${attributes[attributes.length - 1]}` :
attributes[0]; attributes[0];
validator.warn(`A11y: <${name}> element should have ${article} ${sequence} attribute`, node); validator.warn(node, {
code: `a11y-missing-attribute`,
message: `A11y: <${name}> element should have ${article} ${sequence} attribute`
});
} }
} }
function shouldHaveContent() { function shouldHaveContent() {
if (node.children.length === 0) { if (node.children.length === 0) {
validator.warn(`A11y: <${node.name}> element should have child content`, node); validator.warn(node, {
code: `a11y-missing-content`,
message: `A11y: <${node.name}> element should have child content`
});
} }
} }
@ -112,7 +142,10 @@ export default function a11y(
const href = attributeMap.get(attribute); const href = attributeMap.get(attribute);
const value = getStaticAttributeValue(node, attribute); const value = getStaticAttributeValue(node, attribute);
if (value === '' || value === '#') { if (value === '' || value === '#') {
validator.warn(`A11y: '${value}' is not a valid ${attribute} attribute`, href); validator.warn(href, {
code: `a11y-invalid-attribute`,
message: `A11y: '${value}' is not a valid ${attribute} attribute`
});
} }
} }
@ -124,7 +157,10 @@ export default function a11y(
// anchor-in-svg-is-valid // anchor-in-svg-is-valid
shouldHaveValidHref('xlink:href') shouldHaveValidHref('xlink:href')
} else { } else {
validator.warn(`A11y: <a> element should have an href attribute`, node); validator.warn(node, {
code: `a11y-missing-attribute`,
message: `A11y: <a> element should have an href attribute`
});
} }
// anchor-has-content // anchor-has-content
@ -143,7 +179,10 @@ export default function a11y(
shouldHaveContent(); shouldHaveContent();
if (attributeMap.has('aria-hidden')) { if (attributeMap.has('aria-hidden')) {
validator.warn(`A11y: <${node.name}> element should not be hidden`, attributeMap.get('aria-hidden')); validator.warn(attributeMap.get('aria-hidden'), {
code: `a11y-hidden`,
message: `A11y: <${node.name}> element should not be hidden`
});
} }
} }
@ -159,14 +198,20 @@ export default function a11y(
// no-distracting-elements // no-distracting-elements
if (node.name === 'marquee' || node.name === 'blink') { if (node.name === 'marquee' || node.name === 'blink') {
validator.warn(`A11y: Avoid <${node.name}> elements`, node); validator.warn(node, {
code: `a11y-distracting-elements`,
message: `A11y: Avoid <${node.name}> elements`
});
} }
if (node.name === 'figcaption') { if (node.name === 'figcaption') {
const parent = elementStack[elementStack.length - 1]; const parent = elementStack[elementStack.length - 1];
if (parent) { if (parent) {
if (parent.name !== 'figure') { if (parent.name !== 'figure') {
validator.warn(`A11y: <figcaption> must be an immediate child of <figure>`, node); validator.warn(node, {
code: `a11y-structure`,
message: `A11y: <figcaption> must be an immediate child of <figure>`
});
} else { } else {
const children = parent.children.filter(node => { const children = parent.children.filter(node => {
if (node.type === 'Comment') return false; if (node.type === 'Comment') return false;
@ -177,7 +222,10 @@ export default function a11y(
const index = children.indexOf(node); const index = children.indexOf(node);
if (index !== 0 && index !== children.length - 1) { if (index !== 0 && index !== children.length - 1) {
validator.warn(`A11y: <figcaption> must be first or last child of <figure>`, node); validator.warn(node, {
code: `a11y-structure`,
message: `A11y: <figcaption> must be first or last child of <figure>`
});
} }
} }
} }

@ -61,15 +61,18 @@ export default function validateHtml(validator: Validator, html: Node) {
c += 2; c += 2;
while (/\s/.test(validator.source[c])) c += 1; while (/\s/.test(validator.source[c])) c += 1;
validator.warn( validator.warn({ start: c, end: c + node.context.length }, {
`Context clashes with a helper. Rename one or the other to eliminate any ambiguity`, code: `each-context-clash`,
{ start: c, end: c + node.context.length } message: `Context clashes with a helper. Rename one or the other to eliminate any ambiguity`
); });
} }
} }
if (validator.options.dev && isEmptyBlock(node)) { if (validator.options.dev && isEmptyBlock(node)) {
validator.warn('Empty block', node); validator.warn(node, {
code: `empty-block`,
message: 'Empty block'
});
} }
if (node.children) { if (node.children) {

@ -20,14 +20,17 @@ export default function validateElement(
if (!isComponent && /^[A-Z]/.test(node.name[0])) { if (!isComponent && /^[A-Z]/.test(node.name[0])) {
// TODO upgrade to validator.error in v2 // TODO upgrade to validator.error in v2
validator.warn(`${node.name} component is not defined`, node); validator.warn(node, {
code: `missing-component`,
message: `${node.name} component is not defined`
});
} }
if (elementStack.length === 0 && validator.namespace !== namespaces.svg && svg.test(node.name)) { if (elementStack.length === 0 && validator.namespace !== namespaces.svg && svg.test(node.name)) {
validator.warn( validator.warn(node, {
`<${node.name}> is an SVG element did you forget to add { namespace: 'svg' } ?`, code: `missing-namespace`,
node message: `<${node.name}> is an SVG element did you forget to add { namespace: 'svg' } ?`
); });
} }
if (node.name === 'slot') { if (node.name === 'slot') {

@ -30,10 +30,10 @@ export default function validateEventHandlerCallee(
if (name === 'store' && attribute.expression.callee.type === 'MemberExpression') { if (name === 'store' && attribute.expression.callee.type === 'MemberExpression') {
if (!validator.options.store) { if (!validator.options.store) {
validator.warn( validator.warn(attribute.expression, {
'compile with `store: true` in order to call store methods', code: `options-missing-store`,
attribute.expression message: 'compile with `store: true` in order to call store methods'
); });
} }
return; return;
} }
@ -59,5 +59,8 @@ export default function validateEventHandlerCallee(
message += `. '${callee.name}' exists on 'helpers', did you put it in the wrong place?`; message += `. '${callee.name}' exists on 'helpers', did you put it in the wrong place?`;
} }
validator.warn(message, attribute.expression); validator.warn(attribute.expression, {
code: `invalid-callee`,
message
});
} }

@ -69,7 +69,7 @@ export class Validator {
}); });
} }
warn(message: string, pos: { start: number, end: number }) { 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);
const start = this.locator(pos.start); const start = this.locator(pos.start);
const end = this.locator(pos.end); const end = this.locator(pos.end);
@ -77,6 +77,7 @@ export class Validator {
const frame = getCodeFrame(this.source, start.line, start.column); const frame = getCodeFrame(this.source, start.line, start.column);
this.onwarn({ this.onwarn({
code,
message, message,
frame, frame,
loc: { line: start.line + 1, column: start.column }, loc: { line: start.line + 1, column: start.column },
@ -105,6 +106,7 @@ export default function validate(
if (name && /^[a-z]/.test(name)) { if (name && /^[a-z]/.test(name)) {
const message = `options.name should be capitalised`; const message = `options.name should be capitalised`;
onwarn({ onwarn({
code: `options-lowercase-name`,
message, message,
filename, filename,
toString: () => message, toString: () => message,
@ -148,10 +150,10 @@ export default function validate(
definitions.value.properties.forEach(prop => { definitions.value.properties.forEach(prop => {
const { name } = prop.key; const { name } = prop.key;
if (!validator.used[category].has(name)) { if (!validator.used[category].has(name)) {
validator.warn( validator.warn(prop, {
`The '${name}' ${categories[category]} is unused`, code: `unused-${category.slice(0, -1)}`,
prop message: `The '${name}' ${categories[category]} is unused`
); });
} }
}); });
} }

@ -26,7 +26,10 @@ export default function components(validator: Validator, prop: Node) {
} }
if (!/^[A-Z]/.test(name)) { if (!/^[A-Z]/.test(name)) {
validator.warn(`Component names should be capitalised`, component); validator.warn(component, {
code: `component-lowercase`,
message: `Component names should be capitalised`
});
} }
}); });
} }

@ -41,10 +41,10 @@ export default function helpers(validator: Validator, prop: Node) {
}); });
if (prop.value.params.length === 0 && !usesArguments) { if (prop.value.params.length === 0 && !usesArguments) {
validator.warn( validator.warn(prop, {
`Helpers should be pure functions, with at least one argument`, code: `impure-helper`,
prop message: `Helpers should be pure functions, with at least one argument`
); });
} }
}); });
} }

@ -1,11 +1,12 @@
import oncreate from './oncreate'; import oncreate from './oncreate';
import { Validator } from '../../'; import { Validator } from '../../index';
import { Node } from '../../../interfaces'; import { Node } from '../../../interfaces';
export default function onrender(validator: Validator, prop: Node) { export default function onrender(validator: Validator, prop: Node) {
validator.warn( validator.warn(prop, {
`'onrender' has been deprecated in favour of 'oncreate', and will cause an error in Svelte 2.x`, code: `deprecated-onrender`,
prop message: `'onrender' has been deprecated in favour of 'oncreate', and will cause an error in Svelte 2.x`
); });
oncreate(validator, prop); oncreate(validator, prop);
} }

@ -1,11 +1,12 @@
import ondestroy from './ondestroy'; import ondestroy from './ondestroy';
import { Validator } from '../../'; import { Validator } from '../../index';
import { Node } from '../../../interfaces'; import { Node } from '../../../interfaces';
export default function onteardown(validator: Validator, prop: Node) { export default function onteardown(validator: Validator, prop: Node) {
validator.warn( validator.warn(prop, {
`'onteardown' has been deprecated in favour of 'ondestroy', and will cause an error in Svelte 2.x`, code: `deprecated-onteardown`,
prop message: `'onteardown' has been deprecated in favour of 'ondestroy', and will cause an error in Svelte 2.x`
); });
ondestroy(validator, prop); ondestroy(validator, prop);
} }

@ -2,6 +2,7 @@ export default {
cascade: false, cascade: false,
warnings: [{ warnings: [{
code: 'missing-component',
message: 'P component is not defined', message: 'P component is not defined',
loc: { loc: {
line: 2, line: 2,

@ -25,12 +25,8 @@ describe("validate", () => {
const { stats } = svelte.compile(input, { const { stats } = svelte.compile(input, {
onwarn(warning) { onwarn(warning) {
warnings.push({ const { code, message, pos, loc, end } = warning;
message: warning.message, warnings.push({ code, message, pos, loc, end });
pos: warning.pos,
loc: warning.loc,
end: warning.end,
});
}, },
dev: config.dev dev: config.dev
}); });
@ -39,6 +35,7 @@ describe("validate", () => {
stats.warnings.forEach((full, i) => { stats.warnings.forEach((full, i) => {
const lite = warnings[i]; const lite = warnings[i];
assert.deepEqual({ assert.deepEqual({
code: full.code,
message: full.message, message: full.message,
pos: full.pos, pos: full.pos,
loc: full.loc, loc: full.loc,
@ -62,6 +59,7 @@ describe("validate", () => {
throw new Error(`Expected an error: ${expected.message}`); throw new Error(`Expected an error: ${expected.message}`);
} }
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.loc, expected.loc);
assert.deepEqual(error.end, expected.end); assert.deepEqual(error.end, expected.end);
@ -100,6 +98,7 @@ describe("validate", () => {
name: "lowercase", name: "lowercase",
onwarn(warning) { onwarn(warning) {
warnings.push({ warnings.push({
code: warning.code,
message: warning.message, message: warning.message,
pos: warning.pos, pos: warning.pos,
loc: warning.loc loc: warning.loc
@ -108,6 +107,7 @@ describe("validate", () => {
}); });
assert.deepEqual(warnings, [ assert.deepEqual(warnings, [
{ {
code: `options-lowercase-name`,
message: "options.name should be capitalised", message: "options.name should be capitalised",
pos: undefined, pos: undefined,
loc: undefined loc: undefined
@ -121,6 +121,7 @@ describe("validate", () => {
name: "_", name: "_",
onwarn(warning) { onwarn(warning) {
warnings.push({ warnings.push({
code: warning.code,
message: warning.message, message: warning.message,
pos: warning.pos, pos: warning.pos,
loc: warning.loc loc: warning.loc

@ -1,5 +1,6 @@
[ [
{ {
"code": "a11y-missing-attribute",
"message": "A11y: <img> element should have an alt attribute", "message": "A11y: <img> element should have an alt attribute",
"loc": { "loc": {
"line": 1, "line": 1,
@ -13,6 +14,7 @@
}, },
{ {
"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": { "loc": {
"line": 4, "line": 4,
@ -26,6 +28,7 @@
}, },
{ {
"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": { "loc": {
"line": 7, "line": 7,
@ -39,6 +42,7 @@
}, },
{ {
"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": { "loc": {
"line": 9, "line": 9,

@ -1,4 +1,5 @@
[{ [{
"code": "a11y-missing-content",
"message": "A11y: <a> element should have child content", "message": "A11y: <a> element should have child content",
"loc": { "loc": {
"line": 1, "line": 1,

@ -1,5 +1,6 @@
[ [
{ {
"code": "a11y-missing-attribute",
"message": "A11y: <a> element should have an href attribute", "message": "A11y: <a> element should have an href attribute",
"loc": { "loc": {
"line": 1, "line": 1,
@ -12,6 +13,7 @@
"pos": 11 "pos": 11
}, },
{ {
"code": "a11y-invalid-attribute",
"message": "A11y: '' is not a valid xlink:href attribute", "message": "A11y: '' is not a valid xlink:href attribute",
"loc": { "loc": {
"line": 2, "line": 2,
@ -24,6 +26,7 @@
"pos": 65 "pos": 65
}, },
{ {
"code": "a11y-invalid-attribute",
"message": "A11y: '#' is not a valid xlink:href attribute", "message": "A11y: '#' is not a valid xlink:href attribute",
"loc": { "loc": {
"line": 3, "line": 3,

@ -1,5 +1,6 @@
[ [
{ {
"code": "a11y-missing-attribute",
"message": "A11y: <a> element should have an href attribute", "message": "A11y: <a> element should have an href attribute",
"loc": { "loc": {
"line": 1, "line": 1,
@ -12,6 +13,7 @@
"pos": 0 "pos": 0
}, },
{ {
"code": "a11y-invalid-attribute",
"message": "A11y: '' is not a valid href attribute", "message": "A11y: '' is not a valid href attribute",
"loc": { "loc": {
"line": 2, "line": 2,
@ -24,6 +26,7 @@
"pos": 30 "pos": 30
}, },
{ {
"code": "a11y-invalid-attribute",
"message": "A11y: '#' is not a valid href attribute", "message": "A11y: '#' is not a valid href attribute",
"loc": { "loc": {
"line": 3, "line": 3,

@ -1,5 +1,6 @@
[ [
{ {
"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": { "loc": {
"line": 1, "line": 1,
@ -13,6 +14,7 @@
}, },
{ {
"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": { "loc": {
"column": 0, "column": 0,

@ -1,5 +1,6 @@
[ [
{ {
"code": "a11y-unknown-role",
"message": "A11y: Unknown role 'toooltip' (did you mean 'tooltip'?)", "message": "A11y: Unknown role 'toooltip' (did you mean 'tooltip'?)",
"loc": { "loc": {
"line": 1, "line": 1,

@ -1,5 +1,6 @@
[ [
{ {
"code": "a11y-aria-attributes",
"message": "A11y: <meta> should not have aria-* attributes", "message": "A11y: <meta> should not have aria-* attributes",
"loc": { "loc": {
"line": 1, "line": 1,
@ -13,6 +14,7 @@
}, },
{ {
"code": "a11y-misplaced-role",
"message": "A11y: <meta> should not have role attribute", "message": "A11y: <meta> should not have role attribute",
"loc": { "loc": {
"line": 2, "line": 2,

@ -1,5 +1,6 @@
[ [
{ {
"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": { "loc": {
"line": 4, "line": 4,
@ -12,6 +13,7 @@
"pos": 57 "pos": 57
}, },
{ {
"code": "a11y-structure",
"message": "A11y: <figcaption> must be an immediate child of <figure>", "message": "A11y: <figcaption> must be an immediate child of <figure>",
"loc": { "loc": {
"line": 15, "line": 15,

@ -1,5 +1,6 @@
[ [
{ {
"code": "a11y-missing-content",
"message": "A11y: <h1> element should have child content", "message": "A11y: <h1> element should have child content",
"loc": { "loc": {
"line": 1, "line": 1,
@ -13,6 +14,7 @@
}, },
{ {
"code": "a11y-hidden",
"message": "A11y: <h2> element should not be hidden", "message": "A11y: <h2> element should not be hidden",
"loc": { "loc": {
"line": 2, "line": 2,

@ -1,5 +1,7 @@
[ [
{ {
"code": "a11y-missing-attribute",
"message": "A11y: <html> element should have a lang attribute",
"loc": { "loc": {
"column": 0, "column": 0,
"line": 5 "line": 5
@ -8,7 +10,6 @@
"line": 5, "line": 5,
"column": 13 "column": 13
}, },
"message": "A11y: <html> element should have a lang attribute",
"pos": 84 "pos": 84
} }
] ]

@ -1,5 +1,6 @@
[ [
{ {
"code": "a11y-missing-attribute",
"message": "A11y: <iframe> element should have a title attribute", "message": "A11y: <iframe> element should have a title attribute",
"loc": { "loc": {
"line": 1, "line": 1,

@ -1,4 +1,5 @@
[{ [{
"code": "a11y-accesskey",
"message": "A11y: Avoid using accesskey", "message": "A11y: Avoid using accesskey",
"loc": { "loc": {
"line": 1, "line": 1,

@ -1,4 +1,5 @@
[{ [{
"code": "a11y-autofocus",
"message": "A11y: Avoid using autofocus", "message": "A11y: Avoid using autofocus",
"loc": { "loc": {
"line": 1, "line": 1,

@ -1,5 +1,6 @@
[ [
{ {
"code": "a11y-distracting-elements",
"message": "A11y: Avoid <marquee> elements", "message": "A11y: Avoid <marquee> elements",
"loc": { "loc": {
"line": 1, "line": 1,
@ -13,6 +14,7 @@
}, },
{ {
"code": "a11y-distracting-elements",
"message": "A11y: Avoid <blink> elements", "message": "A11y: Avoid <blink> elements",
"loc": { "loc": {
"line": 2, "line": 2,

@ -1,5 +1,6 @@
[ [
{ {
"code": "a11y-autofocus",
"message": "A11y: Avoid using autofocus", "message": "A11y: Avoid using autofocus",
"loc": { "loc": {
"column": 8, "column": 8,

@ -1,5 +1,6 @@
[ [
{ {
"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": { "loc": {
"line": 1, "line": 1,

@ -1,5 +1,6 @@
[ [
{ {
"code": "a11y-positive-tabindex",
"message": "A11y: avoid tabindex values above zero", "message": "A11y: avoid tabindex values above zero",
"loc": { "loc": {
"line": 3, "line": 3,

@ -1,5 +1,6 @@
[ [
{ {
"code": "empty-block",
"message": "Empty block", "message": "Empty block",
"loc": { "loc": {
"line": 1, "line": 1,
@ -12,6 +13,7 @@
"pos": 0 "pos": 0
}, },
{ {
"code": "empty-block",
"message": "Empty block", "message": "Empty block",
"loc": { "loc": {
"line": 5, "line": 5,

@ -1,4 +1,5 @@
[{ [{
"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": { "loc": {
"line": 1, "line": 1,

@ -1,4 +1,5 @@
[{ [{
"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": 54, "pos": 54,
"loc": { "loc": {

@ -1,4 +1,5 @@
[{ [{
"code": "invalid-callee",
"message": "'foo' is an invalid callee (should be one of this.*, event.*, options.*, console.*, 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.*, set, fire, destroy or bar). 'foo' exists on 'helpers', did you put it in the wrong place?",
"pos": 18, "pos": 18,
"loc": { "loc": {

@ -1,4 +1,5 @@
[{ [{
"code": "invalid-callee",
"message": "'foo' is an invalid callee (should be one of this.*, event.*, options.*, console.*, set, fire, destroy or bar)", "message": "'foo' is an invalid callee (should be one of this.*, event.*, options.*, console.*, set, fire, destroy or bar)",
"pos": 18, "pos": 18,
"loc": { "loc": {

@ -1,4 +1,5 @@
[{ [{
"code": "missing-component",
"message": "Widget component is not defined", "message": "Widget component is not defined",
"loc": { "loc": {
"line": 2, "line": 2,

@ -1,4 +1,5 @@
[{ [{
"code": "component-lowercase",
"message": "Component names should be capitalised", "message": "Component names should be capitalised",
"loc": { "loc": {
"line": 6, "line": 6,

@ -1,4 +1,5 @@
[{ [{
"code": "options-missing-store",
"message": "compile with `store: true` in order to call store methods", "message": "compile with `store: true` in order to call store methods",
"loc": { "loc": {
"line": 1, "line": 1,

@ -1,4 +1,5 @@
[{ [{
"code": "missing-namespace",
"message": "<rect> is an SVG element did you forget to add { namespace: 'svg' } ?", "message": "<rect> is an SVG element did you forget to add { namespace: 'svg' } ?",
"loc": { "loc": {
"line": 1, "line": 1,
@ -11,6 +12,7 @@
"pos": 0 "pos": 0
}, },
{ {
"code": "missing-namespace",
"message": "<rect> is an SVG element did you forget to add { namespace: 'svg' } ?", "message": "<rect> is an SVG element did you forget to add { namespace: 'svg' } ?",
"loc": { "loc": {
"column": 1, "column": 1,
@ -23,6 +25,7 @@
"pos": 90 "pos": 90
}, },
{ {
"code": "missing-namespace",
"message": "<rect> is an SVG element did you forget to add { namespace: 'svg' } ?", "message": "<rect> is an SVG element did you forget to add { namespace: 'svg' } ?",
"loc": { "loc": {
"column": 2, "column": 2,
@ -35,6 +38,7 @@
"pos": 191 "pos": 191
}, },
{ {
"code": "missing-namespace",
"message": "<rect> is an SVG element did you forget to add { namespace: 'svg' } ?", "message": "<rect> is an SVG element did you forget to add { namespace: 'svg' } ?",
"loc": { "loc": {
"column": 2, "column": 2,
@ -47,6 +51,7 @@
"pos": 333 "pos": 333
}, },
{ {
"code": "missing-namespace",
"message": "<rect> is an SVG element did you forget to add { namespace: 'svg' } ?", "message": "<rect> is an SVG element did you forget to add { namespace: 'svg' } ?",
"loc": { "loc": {
"column": 2, "column": 2,

@ -1,5 +1,6 @@
[ [
{ {
"code": "unused-component",
"message": "The 'Foo' component is unused", "message": "The 'Foo' component is unused",
"loc": { "loc": {
"line": 7, "line": 7,
@ -12,6 +13,7 @@
"pos": 109 "pos": 109
}, },
{ {
"code": "unused-component",
"message": "The 'Bar' component is unused", "message": "The 'Bar' component is unused",
"loc": { "loc": {
"line": 8, "line": 8,

@ -1,4 +1,5 @@
[{ [{
"code": "unused-event",
"message": "The 'drag' event definition is unused", "message": "The 'drag' event definition is unused",
"loc": { "loc": {
"line": 4, "line": 4,

@ -1,4 +1,5 @@
[{ [{
"code": "unused-transition",
"message": "The 'spin' transition is unused", "message": "The 'spin' transition is unused",
"loc": { "loc": {
"line": 4, "line": 4,

@ -1,4 +1,5 @@
[{ [{
"code": "invalid-callee",
"message": "'resize' is an invalid callee (should be one of this.*, event.*, options.*, console.*, set, fire or destroy)", "message": "'resize' is an invalid callee (should be one of this.*, event.*, options.*, console.*, set, fire or destroy)",
"loc": { "loc": {
"line": 1, "line": 1,

Loading…
Cancel
Save