rizowski/eslint-watch

esw results are doubled/shown twice

Closed this issue · 6 comments

Environment

  • Node Version: 10.7.0 (x64) on Windows 10
  • Eslint-Watch Version: 4.0.2
  • Eslint Version: 5.2.0

Basic Description of the problem

Results are shown properly at startup (only once), but for every file change, they are shown twice.

How to reproduce it

  1. In package.json / scripts: "lint:watch": "esw --watch src scripts"
  2. In Powershell: npm run lint:watch

Debug output:

  1. Started the watcher with clean code
  2. Saved with 1 error
  3. Saved clean

esw --watch "src" "scripts"
✓ Clean (10:33:42 AM)

D:\project\scripts\start_message.js (1/0)
✖ 5:1 Unexpected console statement no-console

✖ 1 error (10:33:49 AM)

D:\project\scripts\start_message.js (1/0)
✖ 5:1 Unexpected console statement no-console

✖ 1 error (10:33:49 AM)

✓ Clean (10:33:52 AM)
✓ Clean (10:33:52 AM)

i see this too

@vzaidman @crinitic Do you guys have anything else running like Prettier that may be formatting on save?

maybe my IDE does something. i think you can try adding a debounce of like 100ms to cope with it.

Probably, another option would be to turn on polling with Chokidar.

Closing this issue since there is an alternative solution using Chokidar through environment variables. CHOKIDAR_USEPOLLING=1

This should be fixed with v5.1.0