diff --git a/packages/svelte/test/css/samples/preserve-unused-selector/_config.js b/packages/svelte/test/css/samples/preserve-unused-selector/_config.js new file mode 100644 index 000000000000..8bf5058a9813 --- /dev/null +++ b/packages/svelte/test/css/samples/preserve-unused-selector/_config.js @@ -0,0 +1,30 @@ +export default { + compileOptions: { + preserveUnusedSelectors: true + }, + warnings: [ + { + filename: 'SvelteComponent.svelte', + code: 'css-unused-selector', + message: 'Unused CSS selector ".bar"', + start: { + line: 8, + column: 1, + character: 60 + }, + end: { + line: 8, + column: 5, + character: 64 + }, + pos: 60, + frame: ` + 6: } + 7: + 8: .bar { + ^ + 9: color: blue; + 10: }` + } + ] +}; diff --git a/packages/svelte/test/css/samples/preserve-unused-selector/expected.css b/packages/svelte/test/css/samples/preserve-unused-selector/expected.css new file mode 100644 index 000000000000..5633dd783fdd --- /dev/null +++ b/packages/svelte/test/css/samples/preserve-unused-selector/expected.css @@ -0,0 +1 @@ +.foo.svelte-xyz{color:red}.bar{color:blue} \ No newline at end of file diff --git a/packages/svelte/test/css/samples/preserve-unused-selector/expected.html b/packages/svelte/test/css/samples/preserve-unused-selector/expected.html new file mode 100644 index 000000000000..cfad41216efe --- /dev/null +++ b/packages/svelte/test/css/samples/preserve-unused-selector/expected.html @@ -0,0 +1 @@ +
\ No newline at end of file diff --git a/packages/svelte/test/css/samples/preserve-unused-selector/input.svelte b/packages/svelte/test/css/samples/preserve-unused-selector/input.svelte new file mode 100644 index 000000000000..1d62e3a67577 --- /dev/null +++ b/packages/svelte/test/css/samples/preserve-unused-selector/input.svelte @@ -0,0 +1,11 @@ +
+ + \ No newline at end of file