From 0733ec009a0b292c1b1165707340b88884192859 Mon Sep 17 00:00:00 2001 From: literat Date: Thu, 24 Aug 2023 11:34:34 +0200 Subject: [PATCH] Style(web-react): Declare missing `prettier` module for types * installing @types/prettier or prettier itself did not help * second options is to use `skipLibCheck: true` --- packages/web-react/src/global.d.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/web-react/src/global.d.ts b/packages/web-react/src/global.d.ts index 7f00d94984..80d2786c9c 100644 --- a/packages/web-react/src/global.d.ts +++ b/packages/web-react/src/global.d.ts @@ -6,3 +6,15 @@ declare module '*.md?raw' { interface Window { console: Console; } + +/** + * Declaring `prettier` module to fix following problem + * + * ../../node_modules/@storybook/components/dist/index.d.ts:5:35 + * error TS7016: Could not find a declaration file for module 'prettier'. '/spirit-design-system/node_modules/prettier/index.js' implicitly has an 'any' type. + * Try `npm i --save-dev @types/prettier` if it exists or add a new declaration (.d.ts) file containing `declare module 'prettier';` + * 5 import { BuiltInParserName } from 'prettier'; + */ +declare module 'prettier' { + export type BuiltInParserName = unknown; +}