mirror of https://github.com/sveltejs/svelte
parent
66201c2fd8
commit
1469da4634
@ -0,0 +1,88 @@
|
|||||||
|
export default {
|
||||||
|
warnings: [
|
||||||
|
{
|
||||||
|
code: "css-unused-selector",
|
||||||
|
frame: `
|
||||||
|
8:
|
||||||
|
9: /* no match */
|
||||||
|
10: .a ~ .b { color: green; }
|
||||||
|
^
|
||||||
|
11: .b ~ .c { color: green; }
|
||||||
|
12: .c ~ .f { color: green; }`,
|
||||||
|
message: 'Unused CSS selector ".a ~ .b"',
|
||||||
|
pos: 111,
|
||||||
|
start: { character: 111, column: 1, line: 10 },
|
||||||
|
end: { character: 118, column: 8, line: 10 },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
code: "css-unused-selector",
|
||||||
|
frame: `
|
||||||
|
9: /* no match */
|
||||||
|
10: .a ~ .b { color: green; }
|
||||||
|
11: .b ~ .c { color: green; }
|
||||||
|
^
|
||||||
|
12: .c ~ .f { color: green; }
|
||||||
|
13: .f ~ .g { color: green; }`,
|
||||||
|
message: 'Unused CSS selector ".b ~ .c"',
|
||||||
|
pos: 138,
|
||||||
|
start: { character: 138, column: 1, line: 11 },
|
||||||
|
end: { character: 145, column: 8, line: 11 },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
code: "css-unused-selector",
|
||||||
|
frame: `
|
||||||
|
10: .a ~ .b { color: green; }
|
||||||
|
11: .b ~ .c { color: green; }
|
||||||
|
12: .c ~ .f { color: green; }
|
||||||
|
^
|
||||||
|
13: .f ~ .g { color: green; }
|
||||||
|
14: .b ~ .f { color: green; }`,
|
||||||
|
message: 'Unused CSS selector ".c ~ .f"',
|
||||||
|
pos: 165,
|
||||||
|
start: { character: 165, column: 1, line: 12 },
|
||||||
|
end: { character: 172, column: 8, line: 12 },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
code: "css-unused-selector",
|
||||||
|
frame: `
|
||||||
|
11: .b ~ .c { color: green; }
|
||||||
|
12: .c ~ .f { color: green; }
|
||||||
|
13: .f ~ .g { color: green; }
|
||||||
|
^
|
||||||
|
14: .b ~ .f { color: green; }
|
||||||
|
15: .b ~ .g { color: green; }`,
|
||||||
|
message: 'Unused CSS selector ".f ~ .g"',
|
||||||
|
pos: 192,
|
||||||
|
start: { character: 192, column: 1, line: 13 },
|
||||||
|
end: { character: 199, column: 8, line: 13 },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
code: "css-unused-selector",
|
||||||
|
frame: `
|
||||||
|
12: .c ~ .f { color: green; }
|
||||||
|
13: .f ~ .g { color: green; }
|
||||||
|
14: .b ~ .f { color: green; }
|
||||||
|
^
|
||||||
|
15: .b ~ .g { color: green; }
|
||||||
|
16: </style>`,
|
||||||
|
message: 'Unused CSS selector ".b ~ .f"',
|
||||||
|
pos: 219,
|
||||||
|
start: { character: 219, column: 1, line: 14 },
|
||||||
|
end: { character: 226, column: 8, line: 14 },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
code: "css-unused-selector",
|
||||||
|
frame: `
|
||||||
|
13: .f ~ .g { color: green; }
|
||||||
|
14: .b ~ .f { color: green; }
|
||||||
|
15: .b ~ .g { color: green; }
|
||||||
|
^
|
||||||
|
16: </style>
|
||||||
|
17:`,
|
||||||
|
message: 'Unused CSS selector ".b ~ .g"',
|
||||||
|
pos: 246,
|
||||||
|
start: { character: 246, column: 1, line: 15 },
|
||||||
|
end: { character: 253, column: 8, line: 15 },
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
@ -0,0 +1 @@
|
|||||||
|
.d.svelte-xyz~.e.svelte-xyz{color:green}.a.svelte-xyz~.g.svelte-xyz{color:green}
|
@ -0,0 +1,30 @@
|
|||||||
|
<script>
|
||||||
|
let App;
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.d ~ .e { color: green; }
|
||||||
|
.a ~ .g { color: green; }
|
||||||
|
|
||||||
|
/* no match */
|
||||||
|
.a ~ .b { color: green; }
|
||||||
|
.b ~ .c { color: green; }
|
||||||
|
.c ~ .f { color: green; }
|
||||||
|
.f ~ .g { color: green; }
|
||||||
|
.b ~ .f { color: green; }
|
||||||
|
.b ~ .g { color: green; }
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<div class="a" />
|
||||||
|
<App>
|
||||||
|
<div class="b" slot="a" />
|
||||||
|
|
||||||
|
<div class="c" slot="b">
|
||||||
|
<div class="d" />
|
||||||
|
<div class="e" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="f" slot="c" />
|
||||||
|
</App>
|
||||||
|
|
||||||
|
<div class="g" />
|
@ -1 +1 @@
|
|||||||
div.svelte-xyz~article.svelte-xyz.svelte-xyz{color:green}span.svelte-xyz~b.svelte-xyz.svelte-xyz{color:green}div.svelte-xyz span.svelte-xyz~b.svelte-xyz{color:green}.a.svelte-xyz~article.svelte-xyz.svelte-xyz{color:green}div.svelte-xyz~.b.svelte-xyz.svelte-xyz{color:green}
|
div.svelte-xyz~article.svelte-xyz.svelte-xyz{color:green}span.svelte-xyz~b.svelte-xyz.svelte-xyz{color:green}div.svelte-xyz span.svelte-xyz~b.svelte-xyz{color:green}.a.svelte-xyz~article.svelte-xyz.svelte-xyz{color:green}div.svelte-xyz~.b.svelte-xyz.svelte-xyz{color:green}.a.svelte-xyz~.c.svelte-xyz.svelte-xyz{color:green}article.svelte-xyz~details.svelte-xyz.svelte-xyz{color:green}.a.svelte-xyz~details.svelte-xyz.svelte-xyz{color:green}
|
@ -1,37 +1,24 @@
|
|||||||
<style>
|
<style>
|
||||||
div ~ article {
|
div ~ article { color: green; }
|
||||||
color: green;
|
span ~ b { color: green; }
|
||||||
}
|
div span ~ b { color: green; }
|
||||||
span ~ b {
|
.a ~ article { color: green; }
|
||||||
color: green;
|
div ~ .b { color: green; }
|
||||||
}
|
.a ~ .c { color: green; }
|
||||||
div span ~ b {
|
article ~ details { color: green; }
|
||||||
color: green;
|
.a ~ details { color: green; }
|
||||||
}
|
|
||||||
.a ~ article {
|
|
||||||
color: green;
|
|
||||||
}
|
|
||||||
div ~ .b {
|
|
||||||
color: green;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* no match */
|
/* no match */
|
||||||
article ~ div {
|
article ~ div { color: green; }
|
||||||
color: green;
|
span ~ article { color: green; }
|
||||||
}
|
b ~ article { color: green; }
|
||||||
span ~ article {
|
span ~ div { color: green; }
|
||||||
color: green;
|
|
||||||
}
|
|
||||||
b ~ article {
|
|
||||||
color: green;
|
|
||||||
}
|
|
||||||
span ~ div {
|
|
||||||
color: green;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div class="a">
|
<div class="a">
|
||||||
<span />
|
<span />
|
||||||
<b />
|
<b />
|
||||||
</div>
|
</div>
|
||||||
<article class="b"></article>
|
<article class="b"></article>
|
||||||
|
<p class="c"></p>
|
||||||
|
<details class="d"></details>
|
@ -0,0 +1,46 @@
|
|||||||
|
export default {
|
||||||
|
warnings: [
|
||||||
|
{
|
||||||
|
code: "css-unused-selector",
|
||||||
|
frame: `
|
||||||
|
7:
|
||||||
|
8: /* no match */
|
||||||
|
9: .a + .b { color: green; }
|
||||||
|
^
|
||||||
|
10: .b + .c { color: green; }
|
||||||
|
11: .c + .f { color: green; }`,
|
||||||
|
message: 'Unused CSS selector ".a + .b"',
|
||||||
|
pos: 84,
|
||||||
|
start: { character: 84, column: 1, line: 9 },
|
||||||
|
end: { character: 91, column: 8, line: 9 }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
code: "css-unused-selector",
|
||||||
|
frame: `
|
||||||
|
8: /* no match */
|
||||||
|
9: .a + .b { color: green; }
|
||||||
|
10: .b + .c { color: green; }
|
||||||
|
^
|
||||||
|
11: .c + .f { color: green; }
|
||||||
|
12: </style>`,
|
||||||
|
message: 'Unused CSS selector ".b + .c"',
|
||||||
|
pos: 111,
|
||||||
|
start: { character: 111, column: 1, line: 10 },
|
||||||
|
end: { character: 118, column: 8, line: 10 }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
code: "css-unused-selector",
|
||||||
|
frame: `
|
||||||
|
9: .a + .b { color: green; }
|
||||||
|
10: .b + .c { color: green; }
|
||||||
|
11: .c + .f { color: green; }
|
||||||
|
^
|
||||||
|
12: </style>
|
||||||
|
13:`,
|
||||||
|
message: 'Unused CSS selector ".c + .f"',
|
||||||
|
pos: 138,
|
||||||
|
start: { character: 138, column: 1, line: 11 },
|
||||||
|
end: { character: 145, column: 8, line: 11 }
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
@ -0,0 +1 @@
|
|||||||
|
.d.svelte-xyz+.e.svelte-xyz{color:green}
|
@ -0,0 +1,24 @@
|
|||||||
|
<script>
|
||||||
|
let App;
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.d + .e { color: green; }
|
||||||
|
|
||||||
|
/* no match */
|
||||||
|
.a + .b { color: green; }
|
||||||
|
.b + .c { color: green; }
|
||||||
|
.c + .f { color: green; }
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<div class="a" />
|
||||||
|
<App>
|
||||||
|
<div class="b" slot="a" />
|
||||||
|
|
||||||
|
<div class="c" slot="b">
|
||||||
|
<div class="d" />
|
||||||
|
<div class="e" />
|
||||||
|
</div>
|
||||||
|
</App>
|
||||||
|
|
||||||
|
<div class="f" />
|
Loading…
Reference in new issue