Fix usage for decorated class properties

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`.
This commit is contained in:
Remco Haszing 2020-10-28 14:02:21 +01:00
parent 57f1632d73
commit b1f7b53df3
No known key found for this signature in database
GPG Key ID: 40D9F5FE9155FD3C