Add plugin to your tsconfig.json
with settings:
{
"compilerOptions": {
"plugins": [
{
"name": "@nderscore/tamagui-typescript-plugin",
// all settings are optional, the defaults are shown below as an example:
//
// relative or absolute path to a tamagui app (parent folder of .tamagui)
"pathToApp": "apps/next",
//
// the default theme to show for theme tokens when inlined
"defaultTheme": "light",
//
// the size (in pixels) of color tiles in previews
"colorTileSize": 18,
//
// options for filtering autocomplete suggestions
"completionFilters": {
//
// set false to hide non-theme color tokens
"showColorTokens": true,
//
// set false to hide $true and $-true tokens from all scales
"showTrueTokens": true,
//
// per-scale lists of specific token names to exclude from autocomplete results
"custom": {
// "themeColor": [],
// "color": [],
// "size": [],
// "space": [],
// "radius": [],
// "zIndex": []
}
}
}
]
}
}
For monorepos:
In a monorepo, like the tamagui starter template, you may have multiple tsconfig.json
for each of your workspace packages. If your packages' configurations extend from one or more base configurations, you should add the plugin to each one of those base configs and not to the individual packages.
For the tamagui starter project, the base tsconfigs are:
tsconfig.json
tsconfig.base.json
apps/next/tsconfig.json