Skip to content

Commit f849408

Browse files
authored
Merge pull request #3817 from sveltejs/revert-3812-tanhauhau/remove-empty-value-declaration
Revert "remove empty value declaration from style tree"
2 parents b6f4c23 + b59c942 commit f849408

File tree

5 files changed

+5
-21
lines changed

5 files changed

+5
-21
lines changed

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
"eslint": "^6.3.0",
7070
"eslint-plugin-import": "^2.18.2",
7171
"eslint-plugin-svelte3": "^2.7.3",
72-
"estree-walker": "^0.9.0",
72+
"estree-walker": "^0.8.1",
7373
"is-reference": "^1.1.4",
7474
"jsdom": "^15.1.1",
7575
"kleur": "^3.0.3",

src/compiler/parse/read/style.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default function read_style(parser: Parser, start: number, attributes: No
3131

3232
// tidy up AST
3333
walk(ast, {
34-
enter(node: any) { // `any` because this isn't an ESTree node
34+
enter: (node: any) => { // `any` because this isn't an ESTree node
3535
// replace `ref:a` nodes
3636
if (node.type === 'Selector') {
3737
for (let i = 0; i < node.children.length; i += 1) {
@@ -47,10 +47,6 @@ export default function read_style(parser: Parser, start: number, attributes: No
4747
}
4848
}
4949

50-
if (node.type === 'Declaration' && node.value.type === 'Value' && node.value.children.length === 0) {
51-
this.remove();
52-
}
53-
5450
if (node.loc) {
5551
node.start = node.loc.start.offset;
5652
node.end = node.loc.end.offset;

test/css/samples/empty-value/expected.css

Lines changed: 0 additions & 1 deletion
This file was deleted.

test/css/samples/empty-value/input.svelte

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)