JSASS_CUSTOM.scss deprecation warning
After recently updating to jsass 5.10.4 / libsass 3.6.4, I now get a deprecation warning every time I compile my SCSS:
DEPRECATION WARNING on line 1 of <blah>/somefile.scss/JSASS_CUSTOM.scss:
!global assignments won't be able to declare new variables in future versions.
Consider adding `$jsass-void: null` at the top level.
While it does not prevent the SCSS from being compiled, it is very distracting as I glance at the cmd line to look for compilation errors - and now these jsass warnings interfere with my own SCSS errors and warnings.
The warning stems from: https://sass-lang.com/documentation/variables
The !global flag may only be used to set a variable that has already been declared at the top level of a file. It may not be used to declare a new variable.
Older Sass versions allowed !global to be used for a variable that doesn’t exist yet. This behavior was deprecated to make sure each stylesheet declares the same variables no matter how it’s executed.
Looking in the jsass code, the warning is caused by io.bit3.jsass.importer.JsassCustomHeaderImporter
:
// $jsass-void: jsass_import_stack_push(<id>) !global;
source.append(
String.format(
"$jsass-void: jsass_import_stack_push(%d) !global;%n",
id
)
);
But to fix it, I'm afraid I don't know the significance of the variable, if it could be imported elsewhere, or if even if the !global
suffix could just be removed!?
I'm by no means a power jsass / libsass / SCSS user, but I do use it for all my (many) projects and websites - great work!