ThisIsManta / stylus-supremacy

A Node.js script that helps formatting Stylus files.
https://thisismanta.github.io/stylus-supremacy
MIT License
88 stars 9 forks source link

More weird parenthesis wrapping #45

Open maranomynet opened 5 years ago

maranomynet commented 5 years ago
$bp[$name] = ($itm.minWidth)px if $itm.minWidth;
$bp[$name + '-min'] = ($itm.minWidth)px if $itm.minWidth;

becomes:

$bp[$name] = ($itm.minWidth) px if ($itm.minWidth);
$bp[($name + '-min')] = ($itm.minWidth) px if ($itm.minWidth);

NOTE The $name + 'min' bit should not be wrapped

Additionally, as I format (save) again this becomes:

$bp[$name] = (($itm.minWidth)) px if ($itm.minWidth);
$bp[(($name + '-min'))] = (($itm.minWidth)) px if ($itm.minWidth);

which becomes:

$bp[$name] = ((($itm.minWidth))) px if ($itm.minWidth);
$bp[((($name + '-min')))] = ((($itm.minWidth))) px if ($itm.minWidth);

which becomes:

$bp[$name] = (((($itm.minWidth)))) px if ($itm.minWidth);
$bp[(((($name + '-min'))))] = (((($itm.minWidth)))) px if ($itm.minWidth);

ad nauseum..

ThisIsManta commented 4 years ago

See my comment at https://github.com/ThisIsManta/stylus-supremacy/issues/55#issuecomment-624569588