Open Xeronic opened 11 months ago
+1 @Rich-Harris
We'd like to not make this change inside svelte.config.js
even if it sounds like the better place, because we need to load it asynchronously, and many code paths in language tools (ts language service, eslint and prettier up until very recently) require synchronousity.
Therefore, IF we do that, I propose to add it to the tsconfig.json instead. We already have a little-known svelteOptions
field in there which we use for Svelte Native currently, and we could put it under there. We wouldn't be the first ones to do that; Angular does it, too.
lang=ts is also used by vite and possibly other tools, we had an effort in svelte-preprocess before and abandoned it because it caused multiple issues.
tsconfig.json is notoriously hard to resolve and means extra work for every .svelte file.
Instead of removing this information from the script tag i propose to make it easier to create new svelte files with the lang=ts already set.
Describe the problem
Having to write
lang=ts
in every file is a tedious thing and not very svelte.Describe the proposed solution
To have a global setting in
svelte.config
to enable it project wide.Alternatives considered
.
Importance
would make my life easier