-
Notifications
You must be signed in to change notification settings - Fork 14
Bug using svelte-check when having tailwind's experimental features turned on #18
Comments
Enabling experimental features will introduce warnings that may confuse people into thinking this project doesn't work. Thanks for hunting down that this is a problem and fixing it. It's clearly an improvement, but I hate CommonJS a lot and don't know for sure if I'll spend the time refactoring all 3 templates (and my own sites that use them) to use it to fix validation and Tailwind CSS IntelliSense. I'd sooner hope for these tools to support ES imports [does VS Code run extensions as CommonJS or something?] than downgrade. Hard situation 😦. |
I also hate CommonJS, it's ugly. However, these experimental features of tailwind will soon be default features. And especially the upgraded I don't know if the makers of svelte-check can make it work with ES6 modules, but if I were you I wouldn't (want to) count on that. |
Not for certain. They're allowed to change, and because they're experimental features, should be opt-in.
Only for validation (which I assume can be overridden with whatever the |
You think there's a chance that the upgraded
Sure, I'm not asking you to turn on those experimental features in your template. Because I agree, they should be opt-in. I'm just asking you to prepare your template such that when someone does opt in, that everything just works as they expect.
True, but looking at the trade-off I'd say that having validation working is much more valuable than having a few config files in ES6 format which we find prettier code to look at. |
So I had also reported this bug in the svelte language tools repo: And their solution was to add a note to their documentation to make clear that you can only use CommonJS in your config files:
In other words, I think this confirms that they have no intention to make svelte check work with a ES6 config file. |
This will be solved when babichjacob/sapper-postcss-template@7f4d826 makes its way downstream here. |
It's more like a ESM-CommonJS-thing that's happening. The problem is that our code is CommonJS and is using |
This has been here as 35d43ac since yesterday but I forgot to point it out |
I looked in to how Do you guys have an issue there that already exists or can you give a short explanation here for what limits you from being |
We currently dynamically require for three things:
|
If you write
export const experimental = "all"
intailwind.config.js
then you get a huge upgrade to the@apply
rule. Namely then you can suddenly write@apply hover:bg-red-200
, which you couldn't do before.Unfortunately however, with how this template is currently set up svelte-check will complain that that is not valid syntax. The reason for that is that
svelte.config.js
doesn't actually usepostcss.config.js
and therefor it doesn't usetailwind.config.js
and therefor svelte-check is not aware that tailwind's experimental feature has been turned on.I've been able to fix it in my own repo. It wasn't quite as simple as just requiring
postcss.config.js
, because all those other config files were written in ES6 format, whilesvelte.config.js
was written in Node format and that makes it impossible to userequire()
. So I had to convert all those config files to Node format.Right now I'm a bit too lazy to open a PR, but here's the commit in which I fixed the problem for myself. One extra benefit of how I have it now, is that
svelte.config.js
is the one and only source of truth regarding preprocessing configuration.The text was updated successfully, but these errors were encountered: