ben-eb / perfectionist

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

Error when ending with a comment #9

Closed Mottie closed 8 years ago

Mottie commented 8 years ago

I was just testing the fix for issue #8, and got an error when the style ends with a comment:

.selector {
  color: white;
}
/* comment */

I see this error:

...\node_modules\perfectionist\node_modules\postcss\lib\lazy-result.js:200
            throw error;
                  ^
TypeError: Cannot set property 'before' of undefined
    at ...\node_modules\perfectionist\dist\index.js:109:36
    at ...\node_modules\perfectionist\node_modules\postcss\lib\container.js:102:26

    at Root.each (...\node_modules\perfectionist\node_modules\postcss\lib\container.js:89:22)
    at Root.eachInside (...\node_modules\perfectionist\node_modules\postcss\lib\container.js:101:21)
    at applyExpanded (...\node_modules\perfectionist\dist\index.js:103:9)
    at ...\node_modules\perfectionist\dist\index.js:199:17
    at LazyResult.run (...\node_modules\perfectionist\node_modules\postcss\lib\lazy-result.js:197:24)
    at LazyResult.sync (...\node_modules\perfectionist\node_modules\postcss\lib\lazy-result.js:183:32)
    at LazyResult.stringify (...\node_modules\perfectionist\node_modules\postcss\lib\lazy-result.js:214:14)
    at LazyResult.get (...\node_modules\perfectionist\node_modules\postcss\lib\lazy-result.js:236:25)
ben-eb commented 8 years ago

Thanks, will take a look. :+1:

ben-eb commented 8 years ago

Released as 1.2.2.

Mottie commented 8 years ago

You rock! :rocket:

ben-eb commented 8 years ago

Thanks. :smile: