Commit 102084a7 authored by Roy Revelt's avatar Roy Revelt

chore: setup refresh

parent 21174667
......@@ -34,6 +34,7 @@
"1.9.2": 26984.638133645025,
"1.9.3": 130251.26373698279,
"1.9.4": 36041.48120260024,
"lastPublished": 36041.48120260024,
"lastRan": 36041.48120260024
"1.9.7": 34245.32718523682,
"lastPublished": 34245.32718523682,
"lastRan": 34245.32718523682
}
\ No newline at end of file
......@@ -30,6 +30,7 @@
"1.9.54": 152192.62800703238,
"1.9.55": 177186.64970879676,
"1.9.56": 193631.0731382082,
"lastPublished": 193631.0731382082,
"lastRan": 193631.0731382082
"1.9.59": 497586.19750061416,
"lastPublished": 497586.19750061416,
"lastRan": 497586.19750061416
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -9,6 +9,7 @@
"0.5.2": 4491.736909740705,
"0.6.0": 4824.145372637357,
"0.6.1": 4671.725356749863,
"lastPublished": 4671.725356749863,
"lastRan": 4671.725356749863
"0.6.4": 3886.938498228121,
"lastPublished": 3886.938498228121,
"lastRan": 3886.938498228121
}
\ No newline at end of file
......@@ -54,7 +54,7 @@
"unused": true
},
"dependencies": {
"dom-serializer": "^0.2.2",
"dom-serializer": "^1.0.1",
"domelementtype": "^2.0.1"
},
"devDependencies": {
......
This diff is collapsed.
This diff is collapsed.
......@@ -25,6 +25,7 @@
"2.17.2": 13117.708887187164,
"2.17.3": 15016.925223884506,
"2.17.4": 6203.310401547028,
"lastPublished": 6203.310401547028,
"lastRan": 6203.310401547028
"2.18.2": 6251.247496579691,
"lastPublished": 6251.247496579691,
"lastRan": 6251.247496579691
}
\ No newline at end of file
......@@ -2,7 +2,7 @@ import tap from "tap";
import { Linter, version } from "../dist/emlint.umd";
tap.test("shows version from UMD build", (t) => {
t.match(version, /\d+\.\d+\.\d+/g);
t.match(version, /\d+\.\d+\.\d+/g, "01");
t.end();
});
......@@ -11,23 +11,23 @@ tap.test("config is truthy and is not an object", (t) => {
const error1 = t.throws(() => {
linter.verify("a", true);
});
t.match(error1.message, /THROW_ID_01/);
t.match(error1.message, /THROW_ID_01/, "02");
t.end();
});
tap.test("config is an empty object", (t) => {
const linter = new Linter();
t.same(linter.verify("a", {}), []);
t.same(linter.verify("a", {}), [], "03");
t.end();
});
tap.test("config is falsey", (t) => {
const linter = new Linter();
t.same(linter.verify("a", null), []);
t.same(linter.verify("a", false), []);
t.same(linter.verify("a", undefined), []);
t.same(linter.verify("a", 0), []);
t.same(linter.verify("a", []), []);
t.same(linter.verify("a", null), [], "04.01");
t.same(linter.verify("a", false), [], "04.02");
t.same(linter.verify("a", undefined), [], "04.03");
t.same(linter.verify("a", 0), [], "04.04");
t.same(linter.verify("a", []), [], "04.05");
t.end();
});
......
......@@ -11,7 +11,7 @@ import { applyFixes } from "../t-util/util";
// -----------------------------------------------------------------------------
tap.test(
`01.01 - ${`\u001b[${33}m${`Apple Safari Web Content Guide`}\u001b[${39}m`} - no rules should be triggered`,
`01 - ${`\u001b[${33}m${`Apple Safari Web Content Guide`}\u001b[${39}m`} - no rules should be triggered`,
(t) => {
const exampleSnippets = [
`<link rel="apple-touch-icon" href="/custom_icon.png"/>`,
......
......@@ -6,7 +6,7 @@ import { applyFixes } from "../../../t-util/util";
// -----------------------------------------------------------------------------
tap.test(
`01.01 - ${`\u001b[${34}m${`validation`}\u001b[${39}m`} - no abbr, error level 0`,
`01 - ${`\u001b[${34}m${`validation`}\u001b[${39}m`} - no abbr, error level 0`,
(t) => {
const str = `<form>`;
const linter = new Linter();
......@@ -15,14 +15,14 @@ tap.test(
"attribute-validate-abbr": 0,
},
});
t.equal(applyFixes(str, messages), str);
t.same(messages, []);
t.equal(applyFixes(str, messages), str, "01.01");
t.same(messages, [], "01.02");
t.end();
}
);
tap.test(
`01.02 - ${`\u001b[${34}m${`validation`}\u001b[${39}m`} - no abbr, error level 1`,
`02 - ${`\u001b[${34}m${`validation`}\u001b[${39}m`} - no abbr, error level 1`,
(t) => {
const str = `<input>`;
const linter = new Linter();
......@@ -31,14 +31,14 @@ tap.test(
"attribute-validate-abbr": 1,
},
});
t.equal(applyFixes(str, messages), str);
t.same(messages, []);
t.equal(applyFixes(str, messages), str, "02.01");
t.same(messages, [], "02.02");
t.end();
}
);
tap.test(
`01.03 - ${`\u001b[${34}m${`validation`}\u001b[${39}m`} - no abbr, error level 2`,
`03 - ${`\u001b[${34}m${`validation`}\u001b[${39}m`} - no abbr, error level 2`,
(t) => {
const str = `<input>`;
const linter = new Linter();
......@@ -47,14 +47,14 @@ tap.test(
"attribute-validate-abbr": 2,
},
});
t.equal(applyFixes(str, messages), str);
t.same(messages, []);
t.equal(applyFixes(str, messages), str, "03.01");
t.same(messages, [], "03.02");
t.end();
}
);
tap.test(
`01.04 - ${`\u001b[${34}m${`validation`}\u001b[${39}m`} - healthy attribute`,
`04 - ${`\u001b[${34}m${`validation`}\u001b[${39}m`} - healthy attribute`,
(t) => {
const str = `<td abbr='something'>`; // <-- notice single quotes
const linter = new Linter();
......@@ -63,8 +63,8 @@ tap.test(
"attribute-validate-abbr": 2,
},
});
t.equal(applyFixes(str, messages), str);
t.same(messages, []);
t.equal(applyFixes(str, messages), str, "04.01");
t.same(messages, [], "04.02");
t.end();
}
);
......@@ -73,7 +73,7 @@ tap.test(
// -----------------------------------------------------------------------------
tap.test(
`02.01 - ${`\u001b[${35}m${`parent`}\u001b[${39}m`} - recognised tag`,
`05 - ${`\u001b[${35}m${`parent`}\u001b[${39}m`} - recognised tag`,
(t) => {
const str = `<div abbr="something">`;
const linter = new Linter();
......@@ -83,21 +83,25 @@ tap.test(
},
});
// can't fix:
t.equal(applyFixes(str, messages), str);
t.match(messages, [
{
ruleId: "attribute-validate-abbr",
idxFrom: 5,
idxTo: 21,
fix: null,
},
]);
t.equal(applyFixes(str, messages), str, "05.01");
t.match(
messages,
[
{
ruleId: "attribute-validate-abbr",
idxFrom: 5,
idxTo: 21,
fix: null,
},
],
"05.02"
);
t.end();
}
);
tap.test(
`02.02 - ${`\u001b[${35}m${`parent`}\u001b[${39}m`} - unrecognised tag`,
`06 - ${`\u001b[${35}m${`parent`}\u001b[${39}m`} - unrecognised tag`,
(t) => {
const str = `<zzz abbr="something" yyy>`;
const linter = new Linter();
......@@ -107,15 +111,19 @@ tap.test(
},
});
// can't fix:
t.equal(applyFixes(str, messages), str);
t.match(messages, [
{
ruleId: "attribute-validate-abbr",
idxFrom: 5,
idxTo: 21,
fix: null,
},
]);
t.equal(applyFixes(str, messages), str, "06.01");
t.match(
messages,
[
{
ruleId: "attribute-validate-abbr",
idxFrom: 5,
idxTo: 21,
fix: null,
},
],
"06.02"
);
t.end();
}
);
......@@ -6,7 +6,7 @@ import { applyFixes } from "../../../t-util/util";
// -----------------------------------------------------------------------------
tap.test(
`01.01 - ${`\u001b[${34}m${`validation`}\u001b[${39}m`} - no accept-charset, error level 0`,
`01 - ${`\u001b[${34}m${`validation`}\u001b[${39}m`} - no accept-charset, error level 0`,
(t) => {
const str = `<div><form>`; // <---- deliberately a tag names of both kinds, suitable and unsuitable
const linter = new Linter();
......@@ -15,14 +15,14 @@ tap.test(
"attribute-validate-accept-charset": 0,
},
});
t.equal(applyFixes(str, messages), str);
t.same(messages, []);
t.equal(applyFixes(str, messages), str, "01.01");
t.same(messages, [], "01.02");
t.end();
}
);
tap.test(
`01.02 - ${`\u001b[${34}m${`validation`}\u001b[${39}m`} - no accept-charset, error level 1`,
`02 - ${`\u001b[${34}m${`validation`}\u001b[${39}m`} - no accept-charset, error level 1`,
(t) => {
const str = `<div><form>`;
const linter = new Linter();
......@@ -31,14 +31,14 @@ tap.test(
"attribute-validate-accept-charset": 1,
},
});
t.equal(applyFixes(str, messages), str);
t.same(messages, []);
t.equal(applyFixes(str, messages), str, "02.01");
t.same(messages, [], "02.02");
t.end();
}
);
tap.test(
`01.03 - ${`\u001b[${34}m${`validation`}\u001b[${39}m`} - no accept-charset, error level 2`,
`03 - ${`\u001b[${34}m${`validation`}\u001b[${39}m`} - no accept-charset, error level 2`,
(t) => {
const str = `<div><form>`;
const linter = new Linter();
......@@ -47,14 +47,14 @@ tap.test(
"attribute-validate-accept-charset": 2,
},
});
t.equal(applyFixes(str, messages), str);
t.same(messages, []);
t.equal(applyFixes(str, messages), str, "03.01");
t.same(messages, [], "03.02");
t.end();
}
);
tap.test(
`01.04 - ${`\u001b[${34}m${`validation`}\u001b[${39}m`} - healthy attribute`,
`04 - ${`\u001b[${34}m${`validation`}\u001b[${39}m`} - healthy attribute`,
(t) => {
const str = `<form accept-charset='utf-8'>`; // <-- notice single quotes
const linter = new Linter();
......@@ -63,14 +63,14 @@ tap.test(
"attribute-validate-accept-charset": 2,
},
});
t.equal(applyFixes(str, messages), str);
t.same(messages, []);
t.equal(applyFixes(str, messages), str, "04.01");
t.same(messages, [], "04.02");
t.end();
}
);
tap.test(
`01.05 - ${`\u001b[${34}m${`validation`}\u001b[${39}m`} - two attrs`,
`05 - ${`\u001b[${34}m${`validation`}\u001b[${39}m`} - two attrs`,
(t) => {
const str = `<form accept-charset="utf-7,utf-8">`;
const linter = new Linter();
......@@ -79,8 +79,8 @@ tap.test(
"attribute-validate-accept-charset": 2,
},
});
t.equal(applyFixes(str, messages), str);
t.same(messages, []);
t.equal(applyFixes(str, messages), str, "05.01");
t.same(messages, [], "05.02");
t.end();
}
);
......@@ -89,7 +89,7 @@ tap.test(
// -----------------------------------------------------------------------------
tap.test(
`02.01 - ${`\u001b[${35}m${`parent`}\u001b[${39}m`} - recognised tag`,
`06 - ${`\u001b[${35}m${`parent`}\u001b[${39}m`} - recognised tag`,
(t) => {
const str = `<div accept-charset='utf-8'>`;
const linter = new Linter();
......@@ -99,21 +99,25 @@ tap.test(
},
});
// can't fix:
t.equal(applyFixes(str, messages), str);
t.match(messages, [
{
ruleId: "attribute-validate-accept-charset",
idxFrom: 5,
idxTo: 27,
fix: null,
},
]);
t.equal(applyFixes(str, messages), str, "06.01");
t.match(
messages,
[
{
ruleId: "attribute-validate-accept-charset",
idxFrom: 5,
idxTo: 27,
fix: null,
},
],
"06.02"
);
t.end();
}
);
tap.test(
`02.02 - ${`\u001b[${35}m${`parent`}\u001b[${39}m`} - unrecognised tag`,
`07 - ${`\u001b[${35}m${`parent`}\u001b[${39}m`} - unrecognised tag`,
(t) => {
const str = `<zzz accept-charset="utf-8" yyy>`;
const linter = new Linter();
......@@ -123,15 +127,19 @@ tap.test(
},
});
// can't fix:
t.equal(applyFixes(str, messages), str);
t.match(messages, [
{
ruleId: "attribute-validate-accept-charset",
idxFrom: 5,
idxTo: 27,
fix: null,
},
]);
t.equal(applyFixes(str, messages), str, "07.01");
t.match(
messages,
[
{
ruleId: "attribute-validate-accept-charset",
idxFrom: 5,
idxTo: 27,
fix: null,
},
],
"07.02"
);
t.end();
}
);
......@@ -140,7 +148,7 @@ tap.test(
// -----------------------------------------------------------------------------
tap.test(
`03.01 - ${`\u001b[${35}m${`parent`}\u001b[${39}m`} - recognised tag`,
`08 - ${`\u001b[${35}m${`parent`}\u001b[${39}m`} - recognised tag`,
(t) => {
const str = `<form accept-charset="utf-z">`;
const linter = new Linter();
......@@ -150,22 +158,26 @@ tap.test(
},
});
// can't fix:
t.equal(applyFixes(str, messages), str);
t.match(messages, [
{
ruleId: "attribute-validate-accept-charset",
idxFrom: 22,
idxTo: 27,
message: `Unrecognised value: "utf-z".`,
fix: null,
},
]);
t.equal(applyFixes(str, messages), str, "08.01");
t.match(
messages,
[
{
ruleId: "attribute-validate-accept-charset",
idxFrom: 22,
idxTo: 27,
message: `Unrecognised value: "utf-z".`,
fix: null,
},
],
"08.02"
);
t.end();
}
);
tap.test(
`03.02 - ${`\u001b[${34}m${`validation`}\u001b[${39}m`} - space after comma`,
`09 - ${`\u001b[${34}m${`validation`}\u001b[${39}m`} - space after comma`,
(t) => {
const str = `<form accept-charset="utf-7, utf-8">`;
const linter = new Linter();
......@@ -174,18 +186,26 @@ tap.test(
"attribute-validate-accept-charset": 2,
},
});
t.equal(applyFixes(str, messages), `<form accept-charset="utf-7,utf-8">`);
t.match(messages, [
{
ruleId: "attribute-validate-accept-charset",
idxFrom: 28,
idxTo: 29,
message: `Remove whitespace.`,
fix: {
ranges: [[28, 29]],
t.equal(
applyFixes(str, messages),
`<form accept-charset="utf-7,utf-8">`,
"09.01"
);
t.match(
messages,
[
{
ruleId: "attribute-validate-accept-charset",
idxFrom: 28,
idxTo: 29,
message: `Remove whitespace.`,
fix: {
ranges: [[28, 29]],
},
},
},
]);
],
"09.02"
);
t.end();
}
);
......@@ -6,7 +6,7 @@ import { applyFixes } from "../../../t-util/util";
// -----------------------------------------------------------------------------
tap.test(
`01.01 - ${`\u001b[${34}m${`validation`}\u001b[${39}m`} - no accesskey, error level 0`,
`01 - ${`\u001b[${34}m${`validation`}\u001b[${39}m`} - no accesskey, error level 0`,
(t) => {
const str = `<a>`;
const linter = new Linter();
......@@ -15,14 +15,14 @@ tap.test(
"attribute-validate-accesskey": 0,
},
});
t.equal(applyFixes(str, messages), str);
t.same(messages, []);
t.equal(applyFixes(str, messages), str, "01.01");
t.same(messages, [], "01.02");
t.end();
}
);
tap.test(
`01.02 - ${`\u001b[${34}m${`validation`}\u001b[${39}m`} - no accesskey, error level 1`,
`02 - ${`\u001b[${34}m${`validation`}\u001b[${39}m`} - no accesskey, error level 1`,