twoslash
twoslash copied to clipboard
how to define plugins in compilerOptions
// tsconfig.json
{
"compilerOptions": {
"jsx": "react",
"jsxFactory": "Html.createElement",
"jsxFragmentFactory": "Html.Fragment",
"plugins": [{ "name": "@kitajs/ts-html-plugin" }]
}
}
```tsx twoslash
// @jsx: react
// @jsxFactory: Html.createElement
// @jsxFragmentFactory: Html.Fragment
// @plugins: [{ "name": "@kitajs/ts-html-plugin" }]
// ---cut---
```
But i recieve
{
title: 'Unknown primitive value in compiler flag',
description: 'The only recognized primitives are number, string and boolean. Got object with [{ "name": "@kitajs/ts-html-plugin" }].',
recommendation: 'This is likely a typo.',
code: undefined
}
I never used TS plugins, but I guess you will need to pass it in JavaScript with the plugin instance rather than the plugin names.
I never used TS plugins, but I guess you will need to pass it in JavaScript with the plugin instance rather than the plugin names.
I am following the instructions from the README and would like to show what error the plugin throws
TS plugins info - https://www.typescriptlang.org/tsconfig#plugins https://github.com/microsoft/TypeScript/wiki/Writing-a-Language-Service-Plugin#whats-a-language-service-plugin