ESLint documentation clearly indicates that node ENV variables should be available in custom formatters, and indeed, if I invoke eslint locally like so:
npx eslint -f path/to/my/formatters.js
It works! And I can see/accessible the desired ENV variables.
However, in Bohemia, we invoke eslint through just-script's eslintTask, and that task does not pass ENV variables on through. Rather, it creates a mostly empty env object and passes that through. As a result, my customer formatter was not receiving the ENV variable it expected.
This simple PR just modifies the env variable passed through to the eslintTask by spreading ...process.env into it when it is initialized.
Overview
ESLint documentation clearly indicates that node ENV variables should be available in custom formatters, and indeed, if I invoke eslint locally like so:
npx eslint -f path/to/my/formatters.js
It works! And I can see/accessible the desired ENV variables.
However, in Bohemia, we invoke eslint through just-script's
eslintTask
, and that task does not pass ENV variables on through. Rather, it creates a mostly empty env object and passes that through. As a result, my customer formatter was not receiving the ENV variable it expected.This simple PR just modifies the
env
variable passed through to theeslintTask
by spreading...process.env
into it when it is initialized.