`./mach eslint devtools/` is not recursive anymore.

RESOLVED WORKSFORME

Status

Testing
General
P1
normal
RESOLVED WORKSFORME
2 years ago
2 years ago

People

(Reporter: janx, Unassigned)

Tracking

Version 3
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

2 years ago
STR:

$ ./mach eslint --setup
$ echo ",syntaxerror," >> devtools/client/aboutdebugging/components/worker-target.js
$ ./mach eslint devtools/

Expected:
- eslint recurses into every sub-directory and catches at least the syntax error

Actual:
- eslint seems to skip "devtools/" because it's a directory, and says "No errors encountered".

Workaround:
$ ./mach eslint devtools/client/aboutdebugging/components/* # works, but is not helpful
Pinging some people who may be able to help with this.
Flags: needinfo?(pbrosset)
Flags: needinfo?(mratcliffe)
This works fine for me using fish on OSX but it depends on your console app.

The key thing is that ** should be set... just google globstar.

Seems to be an age-old eslint issue.
Flags: needinfo?(mratcliffe)
Seems to work for me too on mac and windows. I don't think I've ever encountered errors where eslint was not recursing into sub directories. I found this related issue: https://github.com/eslint/eslint/issues/1663
Flags: needinfo?(pbrosset)
(Reporter)

Comment 4

2 years ago
Well, this problem stopped reproducing after a few updates and `./mach eslint --setup` calls, not sure what changed exactly.

Alex, does it still reproduce on your side?
Flags: needinfo?(poirot.alex)
Still reproduces even after eslint --setup.

./mach eslint devtools/client/aboutdebugging/components/worker-target.js
  reports an error, whereas
./mach eslint devtools/
  doesn't

-v argument doesn't help. Is there a magic option to help debugging that?
Flags: needinfo?(poirot.alex)
Note that I just ran eslint --setup once today:
Installing eslint using "/usr/bin/npm install eslint@2.9.0 -g"...
-
Installing eslint-plugin-mozilla using "/usr/bin/npm link"...

Installing eslint-plugin-html using "/usr/bin/npm install eslint-plugin-html@1.4.0 -g"...

Installing eslint-plugin-react using "/usr/bin/npm install eslint-plugin-react@4.2.3 -g"...

ESLint and approved plugins installed successfully!
(In reply to Alexandre Poirot [:ochameau] from comment #6)
> Note that I just ran eslint --setup once today:
> Installing eslint using "/usr/bin/npm install eslint@2.9.0 -g"...
> -
> Installing eslint-plugin-mozilla using "/usr/bin/npm link"...
> 
> Installing eslint-plugin-html using "/usr/bin/npm install
> eslint-plugin-html@1.4.0 -g"...
> 
> Installing eslint-plugin-react using "/usr/bin/npm install
> eslint-plugin-react@4.2.3 -g"...
> 
> ESLint and approved plugins installed successfully!

Does this mean the problem is now fixed for you?  Or is it still a problem even after the upgrades?
Flags: needinfo?(poirot.alex)
Still broken even if eslint --setup seems to be happy of itself.
Flags: needinfo?(poirot.alex)
Ok. So it was because of an outdated version of eslint being in my path.
eslint -setup works fine and updates it correctly,
but I had another version that took the precedance over npm one and wasn't updating.

I think it will be better with bug 1271706, by warning about outdated versions.
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Depends on: 1271706
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.