Skip to content

Commit

Permalink
fix: incorrect line numbers
Browse files Browse the repository at this point in the history
Still don't know what happened here, the esbuild's example plugin --
https://esbuild.github.io/plugins/#svelte-plugin
does have `start.line - 1` to get the lineText, but that was
wrong in my current test.

Maybe related:
EMH333/esbuild-svelte#83
  • Loading branch information
hyrious committed Apr 21, 2022
1 parent 7639ea6 commit 5b88066
Show file tree
Hide file tree
Showing 6 changed files with 408 additions and 258 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ See [`svelte.compile`](https://svelte.dev/docs#svelte_compile).

## Changelog

### 0.1.6

- Fixed invalid character error because of svelte using the `btoa` in node side.
- Fixed incorrect line numbers in warnings.\
However I still don't know what is wrong here.
The example in esbuild's website does have `start.line - 1`, but my recent test
shows that it should be `start.line`.

### 0.1.4

- Make `svelte()` also the default export.
Expand Down
5 changes: 5 additions & 0 deletions e2e-test/src/App.svelte
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
<script lang="ts">
import External from "./External.svelte";
let count: number = 1;
let b = 0; b === -0; // test warning
</script>

<button on:click={() => count++}>count: {count}</button>
<External />
<p>🚧</p>

<style>
h2 {
/* test warning */
}
button {
color: red;
}
Expand Down

0 comments on commit 5b88066

Please sign in to comment.