sveltejs / vite-plugin-svelte

Svelte plugin for http://vitejs.dev/
MIT License
844 stars 103 forks source link

Improve logging when using svelte-preprocess and external files #703

Closed georges-g closed 1 year ago

georges-g commented 1 year ago

Describe the problem

Hi, thanks for the open source work!

I use svelte-preprocess and external files.

So my src/routes/+page.svelte looks like this:

<template src='./home.pug'></template>
<script src='./home.js'></script>
<style src='./home.sass'></style>

My problem is that vite-plugin-svelte does not seem to care. It logs problems like this:

8:14:11 AM [vite-plugin-svelte] /src/routes/+page.svelte:26:40 A11y: A form label must be associated with a control.

Describe the proposed solution

I would like vite-plugin-svelte to log like this:

8:14:11 AM [vite-plugin-svelte] /src/routes/home.pug:12:5 A11y: A form label must be associated with a control.

Alternatives considered

The only alternative I have at the moment is to use my own linters.

Importance

would make my life easier

dominikg commented 1 year ago

vite-plugin-svelte is just the messenger here.

The issue is that svelte-preprocess does not create a proper sourcemap for external template files. https://github.com/sveltejs/svelte-preprocess/issues/382