Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix usage for decorated class properties #17326

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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`.
  • Loading branch information
remcohaszing committed Oct 28, 2020
commit b1f7b53df3927ae14bfad82197ecbd02e53c29b3
Empty file.