rizowski / eslint-watch

ESLint with simple watching capabilities
https://www.npmjs.com/package/eslint-watch
MIT License
193 stars 29 forks source link

`--watch` doesn't respect file overrides, relies erroneously on `--ext` #193

Open jleider opened 7 months ago

jleider commented 7 months ago

Environment

Basic Description of the problem

Using the --watch and --changed flags don't trigger a re-lint. The initial run will run eslint but any file change for any linted files never get picked up.

Enabling debug mode said my files were getting skipped. Turns out I had to add --ext='.ts,.tsx' but thats not clear from the docs and is not needed for normal eslint when used with file overrides as stated in their docs.

https://eslint.org/docs/latest/use/command-line-interface#--ext

I would expect eslint-watch to respect the underlying eslint behavior in this regard.

How to reproduce it

  1. Broken version: yarn run esw --watch --changed --cache --color --config='.eslintrc.js' '**/*.{ts,tsx}' '.**/*.{ts,tsx}'
  2. Working version: yarn run esw --watch --changed --cache --color --config='.eslintrc.js' --ext='.ts,.tsx' '**/*.{ts,tsx}' '.**/*.{ts,tsx}'