From b1f7b53df3927ae14bfad82197ecbd02e53c29b3 Mon Sep 17 00:00:00 2001 From: Remco Haszing Date: Wed, 28 Oct 2020 14:02:21 +0100 Subject: [PATCH] Fix usage for decorated class properties MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Given the following `tsconfig.json`: ```json { "compilerOptions": { "emitDecoratorMetadata": true, "experimentalDecorators": true } } ``` The following will currently causes an import error: ```ts import { IconName } from '@fortawesome/fontawesome-common-types'; class MyClass { @MyDecorator icon: IconName; } ``` This is because in some situations TypeScript doesn’t know that `IconName` is a only exists as a type. It will generate an import, which can’t be resolved. Simply adding an empty JavaScript file, will make the environment able to import the package, even though the import value of `IconName` will be `undefined`. --- js-packages/@fortawesome/fontawesome-common-types/index.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 js-packages/@fortawesome/fontawesome-common-types/index.js diff --git a/js-packages/@fortawesome/fontawesome-common-types/index.js b/js-packages/@fortawesome/fontawesome-common-types/index.js new file mode 100644 index 000000000..e69de29bb