Page MenuHomePhabricator

"npm test" fails, complaining of "No ESLint configuration found"
Closed, ResolvedPublic

Description

Since rMWc0fb8a883633: build: Replace jscs+jshint with eslint, running npm test on core fails complaining that "No ESLint configuration found", even though the eslint configuration file is present.

It turns out that this occurs when extensions are symlinked from extensions/ and the symlinked extensions have a .js file (e.g. Gruntfile.js) and package.json in their root directory, thanks to grunt's file globbing.

The ** item in grunt's globbing matches symlinks but does not follow them. Thus, when processing **/*.js, the ** matches the symlink extensions/AbuseFilter and it goes on to look for extensions/AbuseFilter/*.js. But when grunt is processing !extensions/** to try to exclude extensions, it sees extensions/AbuseFilter as a match but does not find any files behind that symlink to exclude them.

A quick fix would be to have the exclusion more closely match the inclusion: !extensions/**/*.js would find the same JS files behind the symlink that **/*.js found and so would properly exclude them.

Event Timeline

Anomie created this task.Nov 22 2016, 7:35 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 22 2016, 7:35 PM

Change 322952 had a related patch set uploaded (by Anomie):
Fix globbing for eslint

https://gerrit.wikimedia.org/r/322952

Change 322952 merged by jenkins-bot:
Fix globbing for eslint

https://gerrit.wikimedia.org/r/322952

Anomie closed this task as Resolved.Nov 22 2016, 8:00 PM
Anomie claimed this task.