ben-eb / perfectionist

Beautify CSS files.
MIT License
229 stars 14 forks source link

Got RangeError on some cases #2

Closed Justineo closed 8 years ago

Justineo commented 8 years ago

test.css:

.box {
  -ms-flex-order: 1;
   -webkit-order: 1;
           order: 1;
}
perfectionist test.css

RangeError
    at RangeError (<anonymous>)
    at String.repeat (/usr/local/lib/node_modules/perfectionist/node_modules/string.prototype.repeat/repeat.js:26:11)
    at space (/usr/local/lib/node_modules/perfectionist/dist/space.js:17:16)
    at /usr/local/lib/node_modules/perfectionist/dist/index.js:117:62
    at Array.forEach (native)
    at /usr/local/lib/node_modules/perfectionist/dist/index.js:113:24
    at Array.forEach (native)
    at /usr/local/lib/node_modules/perfectionist/dist/index.js:107:26
    at /usr/local/lib/node_modules/perfectionist/dist/index.js:120:15
    at /usr/local/lib/node_modules/perfectionist/node_modules/postcss/lib/container.js:102:26

In https://github.com/ben-eb/perfectionist/blob/master/src/index.js#L83: vendor - thisVendor is -1 in this case thus repeat went wrong.

ben-eb commented 8 years ago

Thanks, I'll look into it.

ben-eb commented 8 years ago

Released as 1.0.1. Thanks for reporting. :smile:

Justineo commented 8 years ago

:+1: