rizowski / eslint-watch

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

esw results are doubled/shown twice #145

Closed crinitic closed 5 years ago

crinitic commented 5 years ago

Environment

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)

vzaidman commented 5 years ago

i see this too

rizowski commented 5 years ago

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

vzaidman commented 5 years ago

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

rizowski commented 5 years ago

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

rizowski commented 5 years ago

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

rizowski commented 5 years ago

This should be fixed with v5.1.0