Page MenuHomePhabricator

Eliminate usage of mocha-eslint
Open, Needs TriagePublic

Description

The mocha-eslint package has not been updated in over a year, and appears abandoned. It requires an outdated eslint version (^4.2.0) that conflicts with the version required for eslint-config-wikimedia (^5.9.0). It should be removed from all node services.

eslint-config-node-services has been deprecated as well, so it should be replaced with eslint-config-wikimedia with service-specific overrides. See gerritbot comments on the ticket for examples.

I'm sure something have been forgotten here,

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 26 2018, 10:29 PM
Mholloway updated the task description. (Show Details)Nov 27 2018, 12:55 AM
Pchelolo updated the task description. (Show Details)Jan 9 2019, 8:02 PM

Simply replacing the usage of mocha-eslint with latest version of eslint is not a full solution - given that eslint-config-node-services declares eslint as a peer dependency, that creates a peer dependency conflict like T212722

There's been an attempt to unify the configs for javascript within the foundation and as a result eslint-config-wikimedia/server was created. There exist some unanswered questions on which features have to be upstreamed to the Wikimedia config (T211138 and https://github.com/wikimedia/eslint-config-wikimedia/issues/133 ) and how the services have to be changed to accommodate the new config.

As a first step towards finally switching to unified eslint-config-wikimedia, I propose to use this task to collect data on still missing non-unified pieces (tabs vs spaces) is an obvious one. So the services and libs mentioned in the task description have to begin using 'esilnt-config-wikimedia/server' and explicitly use service-specific overrides in .eslintrc of each service required for the linting to pass without changing the codebase.

Doing that for at least a subset of repos and having pull requests with explicit lists in place will allow us to finally see what needs to be upstreamed, what needs to change in the codebase and what needs to stay as a service-specific override.

Ok, I'll remove eslint-config-node-services then and override where necessary

holger.knust updated the task description. (Show Details)Jan 24 2019, 4:56 PM
holger.knust updated the task description. (Show Details)Jan 25 2019, 2:15 PM
holger.knust updated the task description. (Show Details)Jan 25 2019, 4:39 PM
holger.knust updated the task description. (Show Details)Jan 25 2019, 5:17 PM

Change 488908 had a related patch set uploaded (by Mvolz; owner: Mvolz):
[mediawiki/services/citoid@master] Remove jshint && mocha-eslint

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

Mvolz added a subscriber: Mvolz.Feb 7 2019, 11:33 AM

Change 488908 merged by jenkins-bot:
[mediawiki/services/citoid@master] Remove jshint && mocha-eslint

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

Mvolz updated the task description. (Show Details)Feb 7 2019, 11:42 AM

Change 489910 had a related patch set uploaded (by Physikerwelt; owner: Physikerwelt):
[mediawiki/services/mathoid@master] Eliminate mocha-eslint

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

Change 489910 merged by Mobrovac:
[mediawiki/services/mathoid@master] Eliminate mocha-eslint

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

Pchelolo updated the task description. (Show Details)Feb 12 2019, 6:56 PM
Pchelolo updated the task description. (Show Details)
Pchelolo updated the task description. (Show Details)Feb 12 2019, 7:02 PM

Change 492357 had a related patch set uploaded (by Bmansurov; owner: Bmansurov):
[mediawiki/services/recommendation-api@master] Replace istanbul with nyc

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

Change 492357 merged by jenkins-bot:
[mediawiki/services/recommendation-api@master] Replace istanbul with nyc

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

bmansurov updated the task description. (Show Details)Feb 22 2019, 7:29 PM