Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: do not generate unused-export-let inside <script context="module…
- Loading branch information
Showing
3 changed files
with
84 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 45 additions & 22 deletions
67
test/validator/samples/unreferenced-variables/input.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,48 @@ | ||
<script context="module"> | ||
var a1 = 1; | ||
let b1 = 1; | ||
const c1 = 1; | ||
var d1 = 1; | ||
let e1 = 1; | ||
const f1 = 1; | ||
export { d1, e1, f1}; | ||
export var g1 = 1; | ||
export let h1 = 1; | ||
export const i1 = 1; | ||
export let j1 = () => {}; | ||
export const k1 = () => {}; | ||
export function l1() {}; | ||
var m1 = 1; | ||
let n1 = 1; | ||
const o1 = 1; | ||
function foo1() { | ||
return m1 + n1 + o1; | ||
} | ||
export let p1; | ||
</script> | ||
|
||
<script> | ||
var a = 1; | ||
let b = 1; | ||
const c = 1; | ||
var d = 1; | ||
let e = 1; | ||
const f = 1; | ||
export { d, e, f}; | ||
export var g = 1; | ||
export let h = 1; | ||
export const i = 1; | ||
export let j = () => {}; | ||
export const k = () => {}; | ||
export function l() {}; | ||
var m = 1; | ||
let n = 1; | ||
const o = 1; | ||
function foo() { | ||
return m + n + o; | ||
var a2 = 1; | ||
let b2 = 1; | ||
const c2 = 1; | ||
var d2 = 1; | ||
let e2 = 1; | ||
const f2 = 1; | ||
export { d2, e2, f2}; | ||
export var g2 = 1; | ||
export let h2 = 1; | ||
export const i2 = 1; | ||
export let j2 = () => {}; | ||
export const k2 = () => {}; | ||
export function l2() {}; | ||
var m2 = 1; | ||
let n2 = 1; | ||
const o2 = 1; | ||
function foo2() { | ||
return m2 + n2 + o2; | ||
} | ||
export let p; | ||
export let q; | ||
$p; | ||
export let p2; | ||
export let q2; | ||
$p2; | ||
</script> | ||
{$q} | ||
{$q2} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters