ben-eb / perfectionist

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

Prefixed property and comment at end of line issue #3

Closed kfriend closed 8 years ago

kfriend commented 8 years ago

When there's a prefixed property, and a comment at the end of the same line, the following error is hit. I've also included a CSS sample, which caused this issue for me. It's pulled from normalize.css.

TypeError: Cannot read property 'indexOf' of undefined
    at path/to/project/node_modules/perfectionist/dist/index.js:112:37
    at Array.filter (native)
    at path/to/project/node_modules/perfectionist/dist/index.js:110:32
    at Array.forEach (native)
    at path/to/project/node_modules/perfectionist/dist/index.js:107:26
    at path/to/project/node_modules/perfectionist/dist/index.js:121:15
    at path/to/project/node_modules/gulp-postcss/node_modules/postcss/lib/container.js:102:26
    at Root.each (path/to/project/node_modules/gulp-postcss/node_modules/postcss/lib/container.js:89:22)
    at Root.eachInside (path/to/project/node_modules/gulp-postcss/node_modules/postcss/lib/container.js:101:21)
    at applyExpanded (path/to/project/node_modules/perfectionist/dist/index.js:84:9)
html {
  font-family: sans-serif; /* 1 */
  -ms-text-size-adjust: 100%; /* 2 */
  -webkit-text-size-adjust: 100%; /* 2 */
}

Thanks!

ben-eb commented 8 years ago

Thanks for reporting, will take a look soon.

ben-eb commented 8 years ago

Released as 1.0.2.

kfriend commented 8 years ago

Thanks for the quick turnaround!