Page MenuHomePhabricator

Remove jshint and jscs in favor of eslint (linting and code style) in Reading Web code
Closed, ResolvedPublic3 Estimated 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

@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 moved this task from Incoming to Triaged but Future on the Web-Team-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 Web-Team-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.

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

Jdlrobson raised the priority of this task from Medium 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

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

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

Baha, would you mind signing this off?

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

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