Page MenuHomePhabricator

Remove jshint and jscs in favor of eslint (linting and code style) in Reading Web code
Closed, ResolvedPublic3 Story Points

Description

See parent task T118941: Switch to eslint for our linting and our code styling in all Wikimedia JavaScript code

In April 2016, JSCS maintainers joined the ESLint team.

JSCS, the code style linting tool we use in our extensions is end of life and unmaintained going forward.

We need to migrate our extensions to use eslint using the eslint-config-wikimedia preset and remove usage of jscs.

Also, since eslint can perform also the same checks as jshint, we can get rid of it in the process.

Plan

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 26 2016, 3:24 PM

@ovasileva @bmansurov The parent task has been discussed and unstalled since for example VE already uses eslint instead of jscs.

I've created T149202: Migrate RelatedArticles to eslint as a first step to figure out any problems in a small extension before we make the changes to bigger codebases.

bmansurov triaged this task as Normal priority.Oct 26 2016, 8:14 PM
bmansurov moved this task from Incoming to Triaged but Future on the Readers-Web-Backlog board.

@hashar: If you're going to merge T154924 in as a duplicate, could you do the work? That is not for future change-over (repos not yet converted), it's for repos already converted but no-one cleaned up the CI config, like WikiEditor and others.

Jdlrobson renamed this task from Remove jshint and jscs in favor eslint (linting and code style) to [EPIC] Remove jshint and jscs in favor eslint (linting and code style).Feb 10 2017, 7:36 PM
Jdlrobson moved this task from Triaged but Future to Epics/Goals on the Readers-Web-Backlog board.

Related pages was pretty straightforward... but related pages is a small amount of code.
QuickSurveys, Cards or Wikidata-Page-Banner are probably worthy next targets.

Jdlrobson updated the task description. (Show Details)Apr 20 2017, 11:14 PM

^ I think that covers all the extensions we need to migrate?

Jdlrobson raised the priority of this task from Normal to High.Apr 20 2017, 11:15 PM
Jdforrester-WMF renamed this task from [EPIC] Remove jshint and jscs in favor eslint (linting and code style) to [EPIC] Remove jshint and jscs in favor of eslint (linting and code style) in Reading Web code.Apr 20 2017, 11:28 PM

Seems about right

Wondering if this is an epic or an 8 pointer. I feel like it would be good to do all these at the same time.

Jdlrobson renamed this task from [EPIC] Remove jshint and jscs in favor of eslint (linting and code style) in Reading Web code to Remove jshint and jscs in favor of eslint (linting and code style) in Reading Web code.May 10 2017, 12:24 PM
Jdlrobson removed a project: Epic.

I've done a quick run in Quicksurveys and cards and there are between 30 and 60 warnings there, of which 90% are because those projects use mw directly.

This should be a 5 pointer tops. Or a few tasks of 1 or 2 points if wanted.

Jdlrobson set the point value for this task to 3.May 16 2017, 3:39 PM

We chatted about this. Most of the warnings are around mw not being defined. Should be straightforward to fix.

Change 355410 had a related patch set uploaded (by Jhernandez; owner: Jhernandez):
[mediawiki/extensions/QuickSurveys@master] Tools: Use eslint instead of jshint & jscs

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

Change 355419 had a related patch set uploaded (by Jhernandez; owner: Jhernandez):
[mediawiki/extensions/Cards@master] Tools: Use eslint instead of jshint & jscs

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

Change 355420 had a related patch set uploaded (by Jhernandez; owner: Jhernandez):
[mediawiki/extensions/WikidataPageBanner@master] Tools: Use eslint instead of jshint and jscs

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

Jhernandez updated the task description. (Show Details)May 24 2017, 11:19 AM

Change 355420 merged by jenkins-bot:
[mediawiki/extensions/WikidataPageBanner@master] Tools: Use eslint instead of jshint and jscs

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

Change 355419 merged by jenkins-bot:
[mediawiki/extensions/Cards@master] Tools: Use eslint instead of jshint & jscs

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

Change 355410 merged by jenkins-bot:
[mediawiki/extensions/QuickSurveys@master] Tools: Use eslint instead of jshint & jscs

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

Jdlrobson reassigned this task from Jhernandez to bmansurov.May 24 2017, 9:59 PM

Baha, would you mind signing this off?

OK, I'll do so.

The Cards extension still depends on grunt-contrib-jshint and grunt-jscs.

Change 355621 had a related patch set uploaded (by Jhernandez; owner: Jhernandez):
[mediawiki/extensions/Cards@master] Hygiene: Remove unused dependencies

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

Change 355621 merged by jenkins-bot:
[mediawiki/extensions/Cards@master] Hygiene: Remove unused dependencies

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

bmansurov closed this task as Resolved.May 25 2017, 4:32 PM

Mass-moving all items tagged for MediaWiki 1.30.0-wmf.3, as that was never released; instead, we're using -wmf.4.