Closed romaricpascal closed 1 month ago
Name | Link |
---|---|
Latest commit | a830e84f49ba589b3192d4c5030c3f02fc1bc6d7 |
Latest deploy log | https://app.netlify.com/sites/govuk-design-system-preview/deploys/67082e8842a96c0008f54b1a |
Deploy Preview | https://deploy-preview-4207--govuk-design-system-preview.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
As govuk-frontend provides no types, TypeScript will type its exports as
any
but be unable to acknowledge fields inherited from parent classes. This leads to errors when trying to assign or use them.TypeScript's shorthand ambient modules seem to also make inherited fields typed as
any
.This "empty" module will override any other definition of the
govuk-frontend
module, either in another.d.ts
file or in@types/govuk-frontend
.Issue was, our project was not configured to look up for
.ts
file, meaning anyglobal.d.ts
file was overlooked by TypeScript. Adding**/*.d.ts
file to thetsconfig.json
insrc
allows TypeScript to find the shorthand ambient module and TypeScript is happy with accessingthis.$root
in classes inheriting fromComponent
🥳