-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Description
The last statement in the following code block contains the require
that is causing the issue. It could be fixed by adding an import
statement and than assigning that value to the ajv.addMetaSchema()
calll.
The generated file:
// generated by typescript-json-validator
import {inspect} from 'util';
import Ajv = require('ajv');
import ourReportfrom './ourReport';
export const ajv = new ajv({"allErrors":true,"coerceTypes":false,"format":"fast","nullable":true,"unicode":true,"uniqueItems":true,"useDefaults":true});
ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-06.json'));
update:
The following error doesn't like the node_modeuls so the fix doesn't work. Not sure how to fix this yet.
TS6059: File ' _PACKAGE_PATH_\node_modules\ajv\lib\refs\json-schema-draft-06.json' is not under 'rootDir' ' _PACKAGE_PATH_/src'. 'rootDir' is expected to contain all source files.
update:
Temp work-around ->
/* eslint-disable @typescript-eslint/no-var-requires */
Metadata
Metadata
Assignees
Labels
No labels