less-variable-resolver
Resolve variables defined by other variables' values - to allow for conversion into languages not supporting lazy evaluation.
This was developed to be able to use variables declared in a less file inside of SCSS after conversion (e.g. through sast). Take a look at the test cases to better understand the implications and side effects.
Usage example
const gonzales = lessVariableResolver = sast = ; // build AST from lessconst lessTree = gonzales; // resolve variableslessVariableResolver; // convert less to scssconst scssTree = sast; console; // SCSS variables
Development
The following examples use docker
and docker-compose
to ease creating a level playing field for development but are not essential to this project.
Building Docker image
# ensure the node user uses your user id, so you own created files docker-compose build --build-arg UID=$(id -u) --build-arg GID=$(id -g) node
Installation
docker-compose run --rm node npm install
Running code quality tools
docker-compose run --rm node npm test