Skip to content

Commit

Permalink
build(types): use prettier conf on config.types.ts
Browse files Browse the repository at this point in the history
Currently, the `packages/mermaid/src/config.type.ts` types file
(auto-generated via `pnpm run --filter mermaid types:build-config`)
uses the default prettier config.

Instead, we should use the prettier config in the Mermaid repo, as it's
slightly different from the default prettier config.
  • Loading branch information
aloisklink committed Aug 9, 2023
1 parent 85a988c commit 7742a6c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/mermaid/scripts/create-types-from-json-schema.mts
Expand Up @@ -18,6 +18,7 @@ import { promisify } from 'node:util';

import { load, JSON_SCHEMA } from 'js-yaml';
import { compile, type JSONSchema } from 'json-schema-to-typescript';
import prettier from 'prettier';

import _Ajv2019, { type JSONSchemaType } from 'ajv/dist/2019.js';

Expand Down Expand Up @@ -207,6 +208,7 @@ async function generateTypescript(mermaidConfigSchema: JSONSchemaType<MermaidCon
{
additionalProperties: false, // in JSON Schema 2019-09, these are called `unevaluatedProperties`
unreachableDefinitions: true, // definition for FontConfig is unreachable
style: (await prettier.resolveConfig('.')) ?? {},
}
);

Expand Down

0 comments on commit 7742a6c

Please sign in to comment.