Skip to content

v6.2.0

Choose a tag to compare

@XhmikosR XhmikosR released this 06 May 13:24
· 4 commits to main since this release

Bug Fixes

  • fileExtensions whitespace handling: Entries are now trimmed and blank-only arrays are rejected. A leading/trailing space produced a glob like **/*. scss which matched nothing. (f64f809)
  • fusv-disable block comments: Use node.text instead of node.raws.text for fusv directives. node.raws.text is undefined for block-style /* fusv-disable */ comments, causing disable/enable directives to be silently ignored. (565794c)
  • fusvEnabled state leak between parse() calls: fusvEnabled was module-level state never reset between calls. If a file ended with an active fusv-disable and no matching fusv-enable, every subsequent parse() call in the same process would silently drop all variables. (7ea166b)
  • Symlinked directories: Use fs.promises.stat instead of lstat in sanitizeDirAsync. lstat does not follow symlinks, so passing a symlinked directory path would incorrectly throw Not a valid directory!. (949cd6f)
  • filterVariables null guard: Guard against null return from match() to prevent a potential crash. (929f032)

Refactoring

  • Replace private postcss/lib imports with public node.type checks ('decl', 'comment'), making the code resilient to PostCSS internals changing. (4858ef4)
  • Replace VariableParser class with pure functions in lib/parse-variable.js. (a31b9bc)
  • Use explicit key picking in parseOptions instead of object spread. (0e3a909)
  • Use explicit extensions[0] instead of implicit array coercion. (c9480ed)
  • General clean-up of index.js and CLI (bin/cli.js). (ffd08d2, 0e32875)

Performance

  • Use push() instead of spread in makeResults loop to avoid O(n²) allocations. (7d11471)

Tests

  • Replace raw test scripts with uvu and add coverage via c8. (afaf848)

Full Changelog: v6.1.1...v6.2.0