Skip to content

Commit 836980e

Browse files
fix lint error
1 parent b83c2b4 commit 836980e

File tree

3 files changed

+72
-73
lines changed

3 files changed

+72
-73
lines changed

src/error-handlers/format.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const format = async (normalizedErrors, instance, localization) => {
1616
"https://json-schema.org/keyword/draft-2019-09/format",
1717
"https://json-schema.org/keyword/draft-07/format",
1818
"https://json-schema.org/keyword/draft-06/format",
19-
"https://json-schema.org/keyword/draft-04/format",
19+
"https://json-schema.org/keyword/draft-04/format"
2020
];
2121

2222
for (const formatKeyword of formats) {

src/keyword-error-message.test.js

Lines changed: 68 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -698,88 +698,87 @@ describe("Error messages", async () => {
698698
});
699699

700700
test("format: email (draft-07)", async () => {
701-
registerSchema({
702-
$schema: "http://json-schema.org/draft-07/schema",
703-
format: "email"
704-
}, schemaUri);
705-
706-
const instance = "not-an-email";
707-
const output = {
708-
valid: false,
709-
errors: [
701+
registerSchema({
702+
$schema: "http://json-schema.org/draft-07/schema",
703+
format: "email"
704+
}, schemaUri);
705+
706+
const instance = "not-an-email";
707+
const output = {
708+
valid: false,
709+
errors: [
710+
{
711+
absoluteKeywordLocation: "https://example.com/main#/format",
712+
instanceLocation: "#"
713+
}
714+
]
715+
};
716+
717+
const result = await betterJsonSchemaErrors(output, schemaUri, instance);
718+
expect(result.errors).to.eql([
710719
{
711-
absoluteKeywordLocation: "https://example.com/main#/format",
712-
instanceLocation: "#"
720+
schemaLocation: "https://example.com/main#/format",
721+
instanceLocation: "#",
722+
message: localization.getFormatErrorMessage("email")
713723
}
714-
]
715-
};
724+
]);
725+
});
716726

717-
const result = await betterJsonSchemaErrors(output, schemaUri, instance);
718-
expect(result.errors).to.eql([
719-
{
720-
schemaLocation: "https://example.com/main#/format",
721-
instanceLocation: "#",
722-
message: localization.getFormatErrorMessage("email")
723-
}
724-
]);
725-
});
727+
test("format: email (draft-06)", async () => {
728+
registerSchema({
729+
$schema: "http://json-schema.org/draft-06/schema",
730+
format: "email"
731+
}, schemaUri);
732+
733+
const instance = "not-an-email";
734+
const output = {
735+
valid: false,
736+
errors: [
737+
{
738+
absoluteKeywordLocation: "https://example.com/main#/format",
739+
instanceLocation: "#"
740+
}
741+
]
742+
};
726743

727-
test("format: email (draft-06)", async () => {
728-
registerSchema({
729-
$schema: "http://json-schema.org/draft-06/schema",
730-
format: "email"
731-
}, schemaUri);
744+
const result = await betterJsonSchemaErrors(output, schemaUri, instance);
732745

733-
const instance = "not-an-email";
734-
const output = {
735-
valid: false,
736-
errors: [
746+
expect(result.errors).to.eql([
737747
{
738-
absoluteKeywordLocation: "https://example.com/main#/format",
739-
instanceLocation: "#"
748+
schemaLocation: "https://example.com/main#/format",
749+
instanceLocation: "#",
750+
message: localization.getFormatErrorMessage("email")
740751
}
741-
]
742-
};
743-
744-
const result = await betterJsonSchemaErrors(output, schemaUri, instance);
752+
]);
753+
});
745754

746-
expect(result.errors).to.eql([
747-
{
748-
schemaLocation: "https://example.com/main#/format",
749-
instanceLocation: "#",
750-
message: localization.getFormatErrorMessage("email")
751-
}
752-
]);
753-
});
755+
test("format: email (draft-04)", async () => {
756+
registerSchema({
757+
$schema: "http://json-schema.org/draft-04/schema",
758+
format: "email"
759+
}, schemaUri);
754760

755-
test("format: email (draft-04)", async () => {
761+
const instance = "not-an-email";
762+
const output = {
763+
valid: false,
764+
errors: [
765+
{
766+
absoluteKeywordLocation: "https://example.com/main#/format",
767+
instanceLocation: "#"
768+
}
769+
]
770+
};
756771

757-
registerSchema({
758-
$schema: "http://json-schema.org/draft-04/schema",
759-
format: "email"
760-
}, schemaUri);
772+
const result = await betterJsonSchemaErrors(output, schemaUri, instance);
761773

762-
const instance = "not-an-email";
763-
const output = {
764-
valid: false,
765-
errors: [
774+
expect(result.errors).to.eql([
766775
{
767-
absoluteKeywordLocation: "https://example.com/main#/format",
768-
instanceLocation: "#"
776+
schemaLocation: "https://example.com/main#/format",
777+
instanceLocation: "#",
778+
message: localization.getFormatErrorMessage("email")
769779
}
770-
]
771-
};
772-
773-
const result = await betterJsonSchemaErrors(output, schemaUri, instance);
774-
775-
expect(result.errors).to.eql([
776-
{
777-
schemaLocation: "https://example.com/main#/format",
778-
instanceLocation: "#",
779-
message: localization.getFormatErrorMessage("email")
780-
}
781-
]);
782-
});
780+
]);
781+
});
783782

784783
test("pattern", async () => {
785784
registerSchema({

src/normalization-handlers/format.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
/** @type KeywordHandler */
66
const format = {
7-
appliesTo() {
8-
return true;
9-
}
7+
appliesTo() {
8+
return true;
9+
}
1010
};
1111

1212
export default format;

0 commit comments

Comments
 (0)