Page MenuHomePhabricator

Replace usage of jshint and/or jscs with eslint in MediaWiki extensions (clonable)
Open, Needs TriagePublic

Description

jshint and jscs have been slowly removed from Wikimedia's Continuous Integration (CI) linting process. They get replaced with eslint, which handles both static analysis and code style.
Here is an example conversion. You should use the config that's currently on https://www.mediawiki.org/wiki/Manual:Coding_conventions/JavaScript#Linting.

You'll need to remove any references to jshint/jscs, update the dependencies in the file package.json for eslintand eslint-config-wikimedia, configure it to run in Gruntfile.js, and then fix any failures.

The extensions in the list below are candidates for conversion for GCI. Please check them off (means: replace [ ] by [x]) in this Phabricator task if you start working on them, by clicking "Edit Task" in the upper right corner and updating the task description. (You need to be logged into Phabricator to do this. If you do not have an account in Wikimedia Phabricator yet, see the Phabricator help how to create an account here.)

For Wikimedia production extensions/skins, see T195542

Other extensions/skins

  • AnonPrivacy @Zoranzoki21
  • ApprovedRevs
  • ArticleIndex
  • BaseHooks
  • BiblioPlus
  • BibManager
  • BlogPage
  • BlueSpiceFoundation
  • BlueSpiceRating
  • BlueSpiceSocial
  • BreadCrumbs
  • Buggy
  • Cargo
  • CollapsibleVector
  • ConfirmAccount
  • ContributionScores
  • ContributionsList
  • CreatePage
  • CreateRedirect
  • DeviceMapLogCapture
  • DisableAccount
  • Drafts
  • DumpHTML
  • EditSimilar
  • EditUser
  • EmailAuth
  • ExtTab
  • FanBoxes
  • Farmer @Zoranzoki21
  • FundraisingEmailUnsubscribe
  • Genealogy
  • Git2Pages
  • HeaderTabs
  • HoverGallery
  • ImageMetrics
  • ImageTweaks
  • ImportArticles
  • IndexFunction
  • InlineCategorizer
  • InviteSignup
  • JSBreadCrumbs
  • JsonData
  • LanguageSelector
  • LanguageTool
  • LastModified
  • LifeWeb
  • Lingo
  • LinkFilter
  • LinkSuggest
  • Maintenance
  • MaintenanceShell
  • MarkAsHelpful
  • MathSearch
  • MetaMaster
  • MixedNamespaceSearchSuggestions
  • MsUpload
  • MultiMaps
  • NamespacePopups
  • NamespaceSidebar
  • NSFileRepo
  • NukeDPL
  • NumberFormat
  • Numbertext
  • NumerAlpha
  • OdbcDatabase
  • OfflineImportLexicon
  • OnlineStatus
  • OnlineStatusBar
  • OnlyRecentRecentChanges
  • OOJsUIAjaxLogin
  • OpenBadges
  • OpenGraphMeta
  • OpenID
  • OpenLayers
  • OracleTextSearch
  • PageBlock
  • PageCreationNotif
  • PageDisqus
  • PageInCat
  • PageLanguage
  • PageNotice
  • PagePopups
  • PageTools
  • PanScroll
  • PerPageLicense
  • PGFTikZ
  • PhpHighlight
  • PhpTags
  • PhpTagsFunctions
  • PhpTagsMaps
  • PhpTagsSMW
  • PhpTagsStorage
  • PhpTagsWidgets
  • PhpTagsWiki
  • PictureGame
  • PipeEscape
  • Poll
  • PollNY
  • Polyglot
  • PrivateDomains
  • ProtectSite
  • PurgeClickThrough
  • PushToWatch
  • Quantcast
  • QuickSearchLookup
  • QuizGame
  • RandomArea
  • RandomGameUnit
  • RandomImage
  • RandomImageByCategory
  • RandomInCategory
  • RandomPages
  • ReassignEdits
  • RefreshSpecial
  • RegexFun
  • RegexFunctions
  • RelatedSites
  • ReplaceSet
  • RevisionCommentSupplement
  • RightFunctions
  • RT
  • SafeDelete
  • Sarcasm
  • ScanSet
  • Screenplay
  • SecureHTML
  • SecureSessions
  • SelectTag
  • SemanticACL
  • SemanticBundle
  • SemanticDrilldown
  • SemanticGenealogy
  • SemanticInternalObjects
  • SemanticPageSeries
  • SemanticRating
  • SemanticSifter
  • SemanticTasks
  • SemanticWebBrowser
  • ShoutWikiAds
  • SidebarDonateBox
  • SideBarMenu
  • SimpleChanges
  • SimpleFarm
  • SimpleSecurity
  • SiteMetrics
  • SkinPerNamespace
  • SmiteSpam
  • SmoothGallery
  • SocialLogin
  • SocialProfile
  • SoftRedirector
  • SoftwareVersion
  • Solarium
  • SpamDiffTool
  • SpamRegex
  • Spark
  • Special404
  • SpellingApi
  • SphinxSearch
  • SSLClientAuthentication
  • StaffEdits
  • StalkerLog
  • StarterWiki
  • StickToThatLanguage
  • SubpageFun
  • Sudo
  • Survey
  • SVGEdit
  • SwiftMailer
  • Tabs
  • TemplateInfo
  • Theme
  • ThrottleOverride
  • TimelineTable
  • TimeMachine
  • TitleIcon
  • TitleKey
  • TweetANew
  • TwitterLogin
  • UnicodeConverter
  • UploadBlacklist
  • UploadLogo
  • UserGroups
  • UserOptionStats
  • UserStatus
  • UserThrottle
  • Variables
  • VEForAll
  • VoteNY
  • WebChat
  • Widgets
  • WikiArticleFeeds
  • WikiCategoryTagCloud
  • WikiForum
  • WikiLexicalData
  • Amethyst (skin)
  • Anisa (skin)
  • BlueSky (skin)
  • Bouquet (skin)
  • Example (skin)
  • Nimbus (skin)
  • WoOgLeShades (skin)

I can add plenty more extensions if there's demand.

Mentors: @Legoktm, @Jdforrester-WMF and @Esanders

Details

Related Gerrit Patches:
mediawiki/extensions/Farmer : masterbuild: Replace jshint with eslint
mediawiki/skins/Amethyst : masterbuild: Replace jshint/jscs with eslint & stylelint
mediawiki/extensions/YouTube : masterbuild: Replace jshint/jscs with eslint & stylelint
mediawiki/extensions/AnonPrivacy : masterbuild: Replace jshint/jscs with eslint & stylelint
mediawiki/extensions/PageForms : masterUse eslint instead of jshint
mediawiki/services/citoid : masterRemove jshint && mocha-eslint
mediawiki/extensions/CollaborationKit : masterbuild: Replace jshint/jscs with eslint
mediawiki/extensions/GoogleLogin : masterbuild: Replace jshint with eslint & stylelint
mediawiki/extensions/CollaborationKit : masterReplace jslint and jscs with eslint
mediawiki/extensions/CleanChanges : masterbuild: Replace jshint/jscs with eslint & stylelint
mediawiki/extensions/SpamBlacklist : masterbuild: Replace jshint with eslint
mediawiki/extensions/HoverGallery : masterNew version 1.2
mediawiki/extensions/Buggy : masterbuild: Replace jshint/jscs with eslint & stylelint
mediawiki/extensions/DismissableSiteNotice : masterbuild: Replace jshint/jscs with eslint & stylelint

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Change 475841 had a related patch set uploaded (by Zoranzoki21; owner: Zoranzoki21):
[mediawiki/extensions/DismissableSiteNotice@master] build: Replace jshint/jscs with eslint & stylelint

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

Change 475841 merged by jenkins-bot:
[mediawiki/extensions/DismissableSiteNotice@master] build: Replace jshint/jscs with eslint & stylelint

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

Legoktm updated the task description. (Show Details)Nov 27 2018, 10:06 PM
Pjht added a subscriber: Pjht.Nov 28 2018, 7:06 PM
Pjht removed a subscriber: Pjht.

Change 476373 had a related patch set uploaded (by Pjht; owner: Pjht):
[mediawiki/extensions/CollaborationKit@master] Replace jshint with eslint

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

Zoranzoki21 updated the task description. (Show Details)Nov 29 2018, 8:32 AM
Zoranzoki21 added a subscriber: Zoranzoki21.

Change 476457 had a related patch set uploaded (by Zoranzoki21; owner: Zoranzoki21):
[mediawiki/extensions/HoverGallery@master] New version 1.2

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

Aklapper updated the task description. (Show Details)Nov 29 2018, 8:23 PM
Aklapper added a subscriber: Pjht.

Change 476457 abandoned by Zoranzoki21:
New version 1.2

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

Change 476842 had a related patch set uploaded (by Zoranzoki21; owner: Zoranzoki21):
[mediawiki/extensions/Buggy@master] build: Replace jshint/jscs with eslint & stylelint

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

Zoranzoki21 updated the task description. (Show Details)Nov 30 2018, 12:38 PM

Change 476842 abandoned by Zoranzoki21:
build: Replace jshint/jscs with eslint & stylelint

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

Zoranzoki21 updated the task description. (Show Details)Nov 30 2018, 8:14 PM

Change 476917 had a related patch set uploaded (by Zoranzoki21; owner: Zoranzoki21):
[mediawiki/extensions/CleanChanges@master] build: Replace jshint/jscs with eslint & stylelint

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

Change 476571 had a related patch set uploaded (by Jforrester; owner: Esanders):
[mediawiki/extensions/SpamBlacklist@master] build: Replace jshint with eslint

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

Change 476571 merged by jenkins-bot:
[mediawiki/extensions/SpamBlacklist@master] build: Replace jshint with eslint

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

Change 476917 merged by jenkins-bot:
[mediawiki/extensions/CleanChanges@master] build: Replace jshint/jscs with eslint & stylelint

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

Zoranzoki21 updated the task description. (Show Details)Dec 1 2018, 12:40 PM

Change 476373 abandoned by Pjht:
Replace jslint and jscs with eslint

Reason:
This is getting too hard. I’m abandoning this and the GCI task.

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

Zoranzoki21 updated the task description. (Show Details)Dec 5 2018, 6:44 PM

Change 477843 had a related patch set uploaded (by Zoranzoki21; owner: Zoranzoki21):
[mediawiki/extensions/CollaborationKit@master] build: Replace jshint/jscs with eslint & stylelint

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

Change 478422 had a related patch set uploaded (by Stibba; owner: Stibba):
[mediawiki/extensions/GoogleLogin@master] build: Replace jshint with eslint & stylelint

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

Change 478422 merged by jenkins-bot:
[mediawiki/extensions/GoogleLogin@master] build: Replace jshint with eslint & stylelint

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

Zoranzoki21 updated the task description. (Show Details)Jan 2 2019, 6:05 PM

Change 477843 abandoned by Zoranzoki21:
build: Replace jshint/jscs with eslint

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

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:32 AM

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

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

Pjht removed a subscriber: Pjht.Apr 5 2019, 8:23 PM

Change 546761 had a related patch set uploaded (by Samwilson; owner: Samwilson):
[mediawiki/extensions/PageForms@master] Use eslint instead of jshint

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

Change 546761 merged by jenkins-bot:
[mediawiki/extensions/PageForms@master] Use eslint instead of jshint

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

Esanders updated the task description. (Show Details)Nov 1 2019, 10:21 PM
Restricted Application added a subscriber: jeblad. · View Herald TranscriptNov 1 2019, 11:03 PM

Updated the list based on a code search for today.

Change 547847 had a related patch set uploaded (by Zoranzoki21; owner: Zoranzoki21):
[mediawiki/extensions/AnonPrivacy@master] build: Replace jshint/jscs with eslint & stylelint

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

Zoranzoki21 updated the task description. (Show Details)Nov 2 2019, 7:54 PM

Change 547891 had a related patch set uploaded (by Zoranzoki21; owner: Zoranzoki21):
[mediawiki/extensions/YouTube@master] build: Replace jshint/jscs with eslint & stylelint

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

Change 547847 merged by Jforrester:
[mediawiki/extensions/AnonPrivacy@master] build: Replace jshint/jscs with eslint & stylelint

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

Zoranzoki21 updated the task description. (Show Details)Nov 2 2019, 8:19 PM

Change 547893 had a related patch set uploaded (by Zoranzoki21; owner: Zoranzoki21):
[mediawiki/skins/Amethyst@master] build: Replace jshint/jscs with eslint & stylelint

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

Change 547891 merged by jenkins-bot:
[mediawiki/extensions/YouTube@master] build: Replace jshint/jscs with eslint & stylelint

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

Change 547893 merged by jenkins-bot:
[mediawiki/skins/Amethyst@master] build: Replace jshint/jscs with eslint & stylelint

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

@Esanders @Jdforrester-WMF @Legoktm: Are you willing to mentor this once again in Google-Code-in-2019?

Yes, that would be it! Thanks a lot, published!

Aklapper updated the task description. (Show Details)Tue, Nov 26, 1:50 PM

Change 553847 had a related patch set uploaded (by Zoranzoki21; owner: Zoranzoki21):
[mediawiki/extensions/Farmer@master] build: Replace jshint with eslint

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

Zoranzoki21 updated the task description. (Show Details)Sun, Dec 1, 3:38 PM
Da07tar updated the task description. (Show Details)Tue, Dec 3, 4:55 PM

@Da07tar: I'm reverting your last edit, as I don't see a patch for BaseHooks being linked here and being merged in Gerrit. Feel free to clarify :)

Aklapper updated the task description. (Show Details)Tue, Dec 3, 5:03 PM