# Description This PR integrates the prettier check in the github workflow to ensure the code respects the correct formatting standards Fixes #177 馃 --------- Co-authored-by: Ivan Shymko <vana.shimko@gmail.com>
14 lines
453 B
JavaScript
14 lines
453 B
JavaScript
import { compile } from 'json-schema-to-typescript';
|
|
import fs from 'fs';
|
|
import path from 'path';
|
|
|
|
const typeSchemaContents = fs.readFileSync(path.join(process.cwd(), 'spec.json'), 'utf8');
|
|
const typeSchema = JSON.parse(typeSchemaContents.toString());
|
|
|
|
compile(typeSchema, 'MySchema', {
|
|
additionalProperties: false,
|
|
enableConstEnums: false,
|
|
unreachableDefinitions: true,
|
|
unknownAny: true,
|
|
}).then((ts) => fs.writeFileSync('src/types.ts', ts));
|