LeetCode-OpenSource/emotion-ts-plugin

[question] Can this be used in `compilerOptions`?

Andarist opened this issue · 7 comments

I'm wondering if this plugin (or similar) can be added in compilerOptions.plugins? Or does that API doesn't accept transformer plugins?

This plugin is a transformer plugin, compilerOptions.plugins in tsconfig.json only accept Language service plugin, it's different.

@Andarist Do you have any plan to write a Language service plugin for emotion? Maybe I can help you.

I havent planned to write one, was interested only in transformer plugin for other project. It’s real bummer that those cannot be configured in regular way.

Do you have any ideas what language service plugin could do for emotion?

What's the status on this? Emotion doesn't allow you to modify the label and sourceMaps options when you're "just" transpiling with tsc... real bummer. Anyone have an alternative solution ?

@Brooooooklyn thanks for the suggestion, the tool looks interesting but not sure how to use this plugin as a transformer, though you do mention above that this is a transformer plugin 🤔 tried this configuration, let me know if you can help out, otherwise i'll look further into it!

... rest of tsconfig.json
    "declaration": true,
    "declarationMap": true,
    "plugins": [
      {
        "transform": "emotion-ts-plugin",
        "import": "createEmotionPlugin",
        "sourceMap": false,
        "autoLabel": true,
        "labelFormat": "[filename]__[local]"
      }
    ]

Scrap that, the transformer seems to be invoked correctly when using ttypescript's ttsc command, but the transpiled file seems to be the same still, autoLabel and labelFormat don't have any effect