Typescript
Lingui is written in Typescript and ships with TS typings out of the box. You should not need to do anything to get type support working.
Macros types in non-React environments
We investigated how macros can be used on Typescript environments where React isn't required.
Now we're shipping two declaration types:
index.d.tsfiles with@lingui/core,@lingui/reactandreactas peerDependencies.global.d.tsfiles with just@lingui/coreas peerDependencies.
Now you can modify your tsconfig.json in your root directory and reference the global file:
tsconfig.json
{
"compilerOptions": {
"types": ["./node_modules/@lingui/macro/global"]
}
}