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

how to define plugins in compilerOptions #29

Open
kravetsone opened this issue Mar 20, 2024 · 2 comments
Open

how to define plugins in compilerOptions #29

kravetsone opened this issue Mar 20, 2024 · 2 comments

Comments

@kravetsone
Copy link

kravetsone commented Mar 20, 2024

// 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
}
@antfu
Copy link
Member

antfu commented Mar 20, 2024

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.

@kravetsone
Copy link
Author

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

image

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants