I have a pretty simple mix task, actually it wraps npm
command and returns it output to the command line:
defmodule Mix.Tasks.JsLint do
use Mix.Task
@shortdoc "Runs javascript lint"
def run(_args) do
System.cmd("npm", ["run", "lint"], into: IO.stream(:stdio, :line), stderr_to_stdout: true)
end
end
The problem is that if I run npm run lint
in the command line, it returns coloured output. But if I running mix js_lint
it returns not-coloured output.
Where I loose colours? How can I fix that?
UPDATE I'm using eslint.