twind
twind copied to clipboard
Feature request: ability to type-check or leverage eslint to verify usage in CI
Hi - I was wondering if it might be possible to leverage or build on https://github.com/tw-in-js/typescript-plugin to support running those same checks in a CI type environment? Similar to how one might run lint checks in a PR. Would be reallyy helpful to be able to catch type errors at test step in CI.
Sorry, it took so long. Great idea!
So happy to see the response, thank you! I'm reviving our "migrate to twind poc" branch as we speak, in order to try out the WIP twind v1, looking forward to exploring.
Yes, unfortunately Typescript Language Service plugins such as https://github.com/tw-in-js/typescript-plugin are not executed during tsc
command line transpilation/typechecking ... they only activate in Visual Studio Code during the editing experience, see: https://github.com/microsoft/TypeScript/wiki/Writing-a-Language-Service-Plugin
It would be nice if a Twind "checker" could plug into either Prettier, ESLint, or Stylelint ... although the Typescript Language Service plugin (which will at some point be ported to Twind v1, I imagine) does offer a nice DX, i.e. not just highlighting errors, but also providing auto-completion / "intellisense", as well as rich contextual information popup.
I haven't had a chance to investigate how libraries like Stitches provide native TS autocompletions & type checking (that incorporate the custom user defined theme / config no less!), but it is very slick. It's particularly appealing for library authors, so that downstream consumers of a component library etc also get all of that type-checking / autocomplete goodness.