mirror of https://github.com/sveltejs/svelte
fix: empty value attribute selector doesn't produce "Unused CSS selector" warning (#8122)
Fixes: #8042 --------- Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com> Co-authored-by: Yuichiro Yamashita <xydybaseball@gmail.com>pull/8314/head
parent
f6ef6a9349
commit
2a5b488386
@ -0,0 +1,25 @@
|
||||
export default {
|
||||
warnings: [{
|
||||
filename: 'SvelteComponent.svelte',
|
||||
code: 'css-unused-selector',
|
||||
message: 'Unused CSS selector "img[alt=""]"',
|
||||
start: {
|
||||
character: 87,
|
||||
column: 1,
|
||||
line: 8
|
||||
},
|
||||
end: {
|
||||
character: 98,
|
||||
column: 12,
|
||||
line: 8
|
||||
},
|
||||
pos: 87,
|
||||
frame: `
|
||||
6: }
|
||||
7:
|
||||
8: img[alt=""] {
|
||||
^
|
||||
9: border: 1px solid red;
|
||||
10: }`
|
||||
}]
|
||||
};
|
@ -0,0 +1 @@
|
||||
img[alt].svelte-xyz{border:1px solid green}
|
@ -0,0 +1 @@
|
||||
<img alt="a foo" class="svelte-xyz" src="foo.jpg">
|
@ -0,0 +1,11 @@
|
||||
<img src="foo.jpg" alt="a foo" />
|
||||
|
||||
<style>
|
||||
img[alt] {
|
||||
border: 1px solid green;
|
||||
}
|
||||
|
||||
img[alt=""] {
|
||||
border: 1px solid red;
|
||||
}
|
||||
</style>
|
Loading…
Reference in new issue