MCPcopy Index your code
hub / github.com/SchemaStore/schemastore / assertFilePassesJsonLint

Function assertFilePassesJsonLint

cli.js:1706–1724  ·  view source on GitHub ↗
(
  /** @type {DataFile} */ file,
  /** @type {Record<string, unknown> | undefined} */ options = {},
)

Source from the content-addressed store, hash-verified

1704}
1705
1706async function assertFilePassesJsonLint(
1707 /** @type {DataFile} */ file,
1708 /** @type {Record<string, unknown> | undefined} */ options = {},
1709) {
1710 try {
1711 jsonlint.parse(file.text, {
1712 ignoreBOM: false,
1713 ignoreComments: false,
1714 ignoreTrailingCommas: false,
1715 allowSingleQuotedStrings: false,
1716 allowDuplicateObjectKeys: false,
1717 ...options,
1718 })
1719 } catch (err) {
1720 printErrorAndExit(err, [
1721 `Failed strict jsonlint parse of file "./${file.path}"`,
1722 ])
1723 }
1724}
1725
1726async function assertFileValidatesAgainstSchema(
1727 /** @type {string} */ filepath,

Callers 4

taskCheckFunction · 0.85
onSchemaFileFunction · 0.85
onPositiveTestFileFunction · 0.85
onNegativeTestFileFunction · 0.85

Calls 1

printErrorAndExitFunction · 0.85

Tested by

no test coverage detected