postcss-sass icon indicating copy to clipboard operation
postcss-sass copied to clipboard

Fix empty file processing

Open georges-g opened this issue 1 year ago • 0 comments

The processing of an empty file returns the wrong source and breaks stylelint.

See this issue and this code:

> require('postcss-scss').parse('').source
{
  input: Input {
    css: '',
    hasBOM: false,
    id: '<input css zG44F1>',
    [Symbol(fromOffsetCache)]: [ 0 ]
  },
  start: { column: 1, line: 1, offset: 0 },
  end: { column: 1, line: 1, offset: 0 }
}

> require('postcss-sass').parse('').source
{
  start: [ 0, 0 ],
  end: [ 0, 0 ],
  input: Input { css: '', hasBOM: false, id: '<input css Ef1dZl>' }
}

georges-g avatar Sep 06 '23 13:09 georges-g