mirror of https://github.com/sveltejs/svelte
fix: don't consider children of rules when checking whether they are used or not (#13410)
Fixes #13390 There's pruning logic in a different place where all unused selectors are commented out. If all selectors are unused, the whole prelude is commented out, resulting in invalid syntax. This is a case that shouldn't happen, therefore simplify the whole "is used" logic to only look at the prelude.pull/13394/head
parent
e3e8f22a6f
commit
30c438c279
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: don't consider children of rules when checking whether they are used or not
|
@ -0,0 +1,21 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
warnings: [
|
||||
{
|
||||
filename: 'SvelteComponent.svelte',
|
||||
code: 'css_unused_selector',
|
||||
message: 'Unused CSS selector ".unused"',
|
||||
start: {
|
||||
line: 2,
|
||||
column: 1,
|
||||
character: 9
|
||||
},
|
||||
end: {
|
||||
line: 2,
|
||||
column: 8,
|
||||
character: 16
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
@ -0,0 +1,6 @@
|
||||
|
||||
/* (unused) .unused {
|
||||
@media (min-width: 400px) {
|
||||
color: red;
|
||||
}
|
||||
}*/
|
@ -0,0 +1,7 @@
|
||||
<style>
|
||||
.unused {
|
||||
@media (min-width: 400px) {
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
</style>
|
Loading…
Reference in new issue