How to clear plugin-run-script's dashboard between edits #1516
Replies: 2 comments 5 replies
-
I'm having the same problem with ESLint. This solution almost works on Windows as well. However, since
I wonder if there is a portable way to clear the screen. Maybe a Node package? This should be definitely documented on the web page. |
Beta Was this translation helpful? Give feedback.
-
Now that we have the
Is anyone interested in tackling this? Would love the help! If so, I'll spin up a prioritized issue to solve. Basic overview of the changes needed:
|
Beta Was this translation helpful? Give feedback.
-
The problem
Output on the dashboard is not magically cleared between file changes by plugin-run-script. This means that the output generally duplicates between saves, making for extremely long and dubious dashboards full of old and irrelevant data.
After saving a file 2 times, a dashboard might look something like this
That is the same output, 3 times. First one being the initial load, other two triggered by file changes.
This quickly builds up when you have multiple files and dashboards reporting problems.
The solution
We need to clear the dashboard. plugin-run-script currently looks for
\x1bc
and will clear the dashboards content if it is encountered. So we can clear the dashboard between file changes by injecting that between runs.Important new bits include
FORCE_COLOR=1
chokidar "<someGlob>"
<someGlob>
.--initial
-c "<someCommand>"
<someCommand>
every time the files changeecho -e '\x1bc'
$1
cmd
field.Note I used
chokidar
for watching instead ofsvelte-check --watch
sincesvelte-check --watch
would not clear the screen between file changes.I prefer
chokidar-cli
overwatch
from npm since it allows me to narrow down what triggers the dashboard to run and reduce wasted cycles.Beta Was this translation helpful? Give feedback.
All reactions