diff --git a/src/clean-ast.js b/src/clean-ast.js index 6df8a6109..6224409c1 100644 --- a/src/clean-ast.js +++ b/src/clean-ast.js @@ -61,6 +61,10 @@ function massageAST(ast) { delete newObj.value; } + if (ast.type === "css-rule") { + delete newObj.params; + } + // We convert
to
if (ast.type === "JSXOpeningElement") { delete newObj.selfClosing; diff --git a/tests/css_params/__snapshots__/jsfmt.spec.js.snap b/tests/css_params/__snapshots__/jsfmt.spec.js.snap new file mode 100644 index 000000000..96928cb6f --- /dev/null +++ b/tests/css_params/__snapshots__/jsfmt.spec.js.snap @@ -0,0 +1,13 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`params.css 1`] = ` +.clusterPlannerDialog input[type="text"], +.clusterPlannerDialog .uiTypeahead { + width: 220px; +} +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.clusterPlannerDialog input[type="text"], .clusterPlannerDialog .uiTypeahead { + width: 220px; +} + +`; diff --git a/tests/css_params/jsfmt.spec.js b/tests/css_params/jsfmt.spec.js new file mode 100644 index 000000000..a7d303b6c --- /dev/null +++ b/tests/css_params/jsfmt.spec.js @@ -0,0 +1 @@ +run_spec(__dirname, { parser: "postcss" }); diff --git a/tests/css_params/params.css b/tests/css_params/params.css new file mode 100644 index 000000000..22a4ee345 --- /dev/null +++ b/tests/css_params/params.css @@ -0,0 +1,4 @@ +.clusterPlannerDialog input[type="text"], +.clusterPlannerDialog .uiTypeahead { + width: 220px; +}