Open billyzkid opened 1 year ago
Hi,
I ran into this issue and i fixed it by using the --ext
option eg:
esw ./src --ext .ts
I was also surprised esw wasn't a drop in wrapper for eslint.
To make it act similar to tsc --watch
:
esw src/ test/ --ext .ts --watch --changed --clear --color
The worst part is having to hardcode paths, when I don't have to do that when calling eslint .
directly.
Environment
Basic Description of the problem
Basically, it did not work out of the box as expected for me. I would expect a "wrapper" to allow the
esw
CLI to be a drop-in replacement foreslint
, but several things either worked differently or not at all.For example, here are the simple lint scripts I use in package.json along with a fairly vanilla .eslintrc for a TypeScript project:
I installed
eslint-watch
and updated it to this:which gave me this error for
npm run lint
:so I updated it to this:
which worked, but the errors were not displayed in color as they are for
eslint
by default. So I changed it to this:Now it was linting with color. But then I tried adding the
--clear
option. Nothing happened when I rannpm run lint
. Perhaps it requires--watch
, but the docs aren't clear here. So I rannpm run lint:fix
and suddenly the terminal was cleared. I don't understand the expected behavior.Bottom line is
eslint-watch
feels too brittle and unpredictable to use, which is a bit surprising to me for such a popular package.