Page MenuHomePhabricator

Stop using jsonlint and instead use eslint-plugin-json for the linting
Open, Needs TriagePublic

Description

Using [[https://github.com/wikimedia/eslint-config-wikimedia/issues/166|upstream patch in eslint-config-wikimedia v0.12.0]] with local configuration.

Wikimedia production repos to fix:

  • extensions / ApiFeatureUsage
  • extensions / ArticlePlaceholder
  • extensions / BounceHandler
  • extensions / Calendar
  • extensions / Capiunto
  • extensions / CharInsert
  • extensions / cldr
  • extensions / CodeReview
  • extensions / Cognate
  • extensions / Collection
  • extensions / CommonsMetadata
  • extensions / CongressLookup
  • extensions / ContactPage (@Majavah)
  • extensions / CreditsSource
  • extensions / Dashiki
  • extensions / Disambiguator
  • extensions / DismissableSiteNotice
  • extensions / DoubleWiki
  • extensions / DynamicSidebar
  • extensions / EntitySchema
  • extensions / EventLogging
  • extensions / ExtensionDistributor
  • extensions / ExternalGuidance
  • extensions / FeaturedFeeds
  • extensions / FileExporter
  • extensions / FileImporter
  • extensions / FlaggedRevs
  • extensions / FundraiserLandingPage
  • extensions / FundraisingTranslateWorkflow
  • extensions / GeoCrumbs
  • extensions / GeoData
  • extensions / GettingStarted
  • extensions / GlobalBlocking
  • extensions / GlobalPreferences
  • extensions / GlobalUserPage
  • extensions / GoogleNewsSitemap
  • extensions / GrowthExperiments
  • extensions / GuidedTour
  • extensions / GWToolset
  • extensions / Insider (@Majavah)
  • extensions / intersection
  • extensions / InterwikiSorting
  • extensions / Jade
  • extensions / Josa
  • extensions / LandingCheck
  • extensions / LdapAuthentication
  • extensions / Linter
  • extensions / LiquidThreads
  • extensions / Listings
  • extensions / LoginNotify
  • extensions / MapSources
  • extensions / MassMessage
  • extensions / MobileApp
  • extensions / Newsletter
  • extensions / NewUserMessage (@Majavah)
  • extensions / OAuth
  • extensions / ORES
  • extensions / PagedTiffHandler
  • extensions / PageTriage
  • extensions / PageViewInfo
  • extensions / Petition
  • extensions / PoolCounter
  • extensions / QuickSurveys
  • extensions / Quiz
  • extensions / ReadingLists
  • extensions / RelatedArticles
  • extensions / RSS
  • extensions / SandboxLink
  • extensions / SearchExtraNS
  • extensions / SecureLinkFixer
  • extensions / SecurePoll
  • extensions / ShortUrl (@Majavah)
  • extensions / SubPageList3
  • extensions / SubpageSortkey
  • extensions / TemplateSandbox
  • extensions / TemplateStyles
  • extensions / TemplateWizard
  • extensions / TheWikipediaLibrary
  • extensions / timeline
  • extensions / TocTree
  • extensions / TorBlock
  • extensions / TranslationNotifications
  • extensions / TrustedXFF (@Majavah)
  • extensions / UploadsLink
  • extensions / WikibaseLexeme
  • extensions / WikibaseQualityConstraints
  • extensions / WikidataPageBanner
  • extensions / wikihiero
  • extensions / WikimediaBadges
  • extensions / WikimediaEditorTasks
  • extensions / WikimediaIncubator
  • extensions / Wikisource
  • skins / CologneBlue
  • skins / Modern
  • skins / MonoBook
  • skins / Nostalgia
  • skins / Timeless @RetroCraft

Details

ProjectBranchLines +/-Subject
mediawiki/extensions/Capiuntomaster+798 -261
mediawiki/skins/Nostalgiamaster+819 -281
mediawiki/extensions/EmailCapturemaster+1 K -200
mediawiki/extensions/EmailCapturemaster+1 K -153
mediawiki/extensions/PhpTagsStoragemaster+994 -407
mediawiki/extensions/OnlineStatusmaster+1 K -472
mediawiki/extensions/HTMLTagsmaster+1 K -200
mediawiki/extensions/PhpTagsmaster+995 -410
mediawiki/extensions/PhpHighlightmaster+995 -410
mediawiki/extensions/Insidermaster+837 -281
mediawiki/extensions/ShortUrlmaster+579 -296
mediawiki/extensions/PageBlockmaster+1 K -443
mediawiki/extensions/NewUserMessagemaster+5 -94
mediawiki/extensions/TrustedXFFmaster+4 -30
mediawiki/extensions/FileExportermaster+872 -78
mediawiki/extensions/Cognatemaster+895 -79
mediawiki/extensions/FileImportermaster+853 -933
mediawiki/extensions/PrivateDomainsmaster+995 -410
mediawiki/extensions/PaginateTextmaster+1 K -216
mediawiki/extensions/PushToWatchmaster+816 -193
mediawiki/extensions/RandomPagesmaster+995 -409
mediawiki/extensions/RandomAreamaster+995 -409
mediawiki/extensions/PageLanguagemaster+995 -410
mediawiki/extensions/PageCreationNotifmaster+995 -410
mediawiki/skins/Timelessmaster+233 -201
mediawiki/extensions/CreateRedirectmaster+872 -297
mediawiki/extensions/Pollmaster+870 -285
mediawiki/extensions/HoverGallerymaster+3 K -254
mediawiki/extensions/GoogleAdSensemaster+894 -75
mediawiki/extensions/Calendarmaster+1 K -637
mediawiki/extensions/WebChatmaster+749 -1 K
mediawiki/extensions/ContactPagemaster+6 -44
mediawiki/extensions/VisualEditormaster+1 -1
mediawiki/extensions/PropertySuggestermaster+21 -31
mediawiki/extensions/Echomaster+7 -18
mediawiki/extensions/AntiSpoofmaster+6 -14
mediawiki/extensions/GlobalCssJsmaster+5 -13
mediawiki/extensions/CentralAuthmaster+7 -13
mediawiki/extensions/BetaFeaturesmaster+5 -14
mediawiki/extensions/CategoryTreemaster+9 -14
mediawiki/extensions/ContentTranslationmaster+7 -17
mediawiki/extensions/AbuseFiltermaster+4 -12
mediawiki/extensions/Babelmaster+9 -17
mediawiki/extensions/Campaignsmaster+7 -13
mediawiki/extensions/Nukemaster+6 -14
mediawiki/extensions/3Dmaster+5 -14
mediawiki/coremaster+5 -12
mediawiki/extensions/Citemaster+5 -17
mediawiki/extensions/CirrusSearchmaster+5 -14
mediawiki/skins/MinervaNeuemaster+4 -14
mediawiki/extensions/MobileFrontendmaster+4 -14
mediawiki/extensions/VisualEditormaster+5 -16
VisualEditor/VisualEditormaster+58 -92
Show related patches Customize query in gerrit

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
Majavah updated the task description. (Show Details)
Majavah removed the point value for this task.

Change 560090 had a related patch set uploaded (by Zoranzoki21; owner: Zoranzoki21):
[mediawiki/extensions/Calendar@master] build: Replace jshint/jsonlint with eslint, update dev dependencies

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

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

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

Change 560553 merged by jenkins-bot:
[mediawiki/extensions/WebChat@master] build: Replace jshint/jsonlint with eslint

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

Change 560090 merged by jenkins-bot:
[mediawiki/extensions/Calendar@master] build: Replace jshint/jsonlint with eslint, update dev dependencies

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

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

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

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

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

Change 560811 had a related patch set uploaded (by Zoranzoki21; owner: Zoranzoki21):
[mediawiki/extensions/EmailCapture@master] New version 0.5.0

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

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

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

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

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

Change 560881 merged by jenkins-bot:
[mediawiki/extensions/GoogleAdSense@master] build: Replace jshint/jsonlint with eslint

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

Change 560879 merged by jenkins-bot:
[mediawiki/extensions/HoverGallery@master] build: Replace jshint/jsonlint with eslint

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

Change 560590 merged by jenkins-bot:
[mediawiki/extensions/Poll@master] build: Replace jshint/jsonlint with eslint

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

Change 560799 merged by jenkins-bot:
[mediawiki/extensions/CreateRedirect@master] build: Replace jshint/jsonlint with eslint

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

Change 562073 had a related patch set uploaded (by RetroCraft; owner: RetroCraft):
[mediawiki/skins/Timeless@master] Remove jsonlint, upgrade eslint-config-wikimedia

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

I've submitted a patch to Timeless, however the project was on an outdated version of eslint-config-wikimedia which did not yet include JSON linting. I upgraded eslint-config-wikimedia and grunt-eslint, but there are lint errors introduced by the config change (specifically, no-jquery/no-fade and no-jquery/no-global-selector). Is the best practice to just line-by-line eslint ignore the errors, file-by-file, or disable the rule entirely project-wide?

I've submitted a patch to Timeless, however the project was on an outdated version of eslint-config-wikimedia which did not yet include JSON linting. I upgraded eslint-config-wikimedia and grunt-eslint, but there are lint errors introduced by the config change (specifically, no-jquery/no-fade and no-jquery/no-global-selector). Is the best practice to just line-by-line eslint ignore the errors, file-by-file, or disable the rule entirely project-wide?

If the usage is widespread in the code, disabling it project-wide is best. If there are only maybe five uses, disable it inline. We generally don't do file-level disables as they're confusing when moving code around. Thank you!

RetroCraft updated the task description. (Show Details)Jan 7 2020, 1:09 AM

Change 562073 merged by jenkins-bot:
[mediawiki/skins/Timeless@master] Remove jsonlint, upgrade eslint-config-wikimedia

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

I wonder, what to do with extensions, that currently do not use eslint and do not have any JS code. Should we still add eslint then "just" for the json checks?

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

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

I wonder, what to do with extensions, that currently do not use eslint and do not have any JS code. Should we still add eslint then "just" for the json checks?

Yes.

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

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

Change 563446 merged by jenkins-bot:
[mediawiki/extensions/PageCreationNotif@master] build: Replace jshint/jsonlint with eslint

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

Change 563549 merged by jenkins-bot:
[mediawiki/extensions/PageLanguage@master] build: Replace jshint/jsonlint with eslint

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

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

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

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

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

Change 563569 merged by jenkins-bot:
[mediawiki/extensions/RandomArea@master] build: Replace jshint/jsonlint with eslint

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

Change 563571 merged by jenkins-bot:
[mediawiki/extensions/RandomPages@master] build: Replace jshint/jsonlint with eslint

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

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

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

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

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

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

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

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

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

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

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

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

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

Change 563739 merged by jenkins-bot:
[mediawiki/extensions/PushToWatch@master] build: Replace jshint/jsonlint with eslint

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

Change 563627 merged by jenkins-bot:
[mediawiki/extensions/PaginateText@master] build: Replace jshint/jsonlint with eslint

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

Change 564075 had a related patch set uploaded (by WMDE-Fisch; owner: WMDE-Fisch):
[mediawiki/extensions/FileImporter@master] build: Replace jsonhint, update eslint, update wdio conf

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

Change 563732 merged by jenkins-bot:
[mediawiki/extensions/PrivateDomains@master] build: Replace jshint/jsonlint with eslint

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

I just want note that grunt-jsonlint has get a major release to version 2 and supports indent check and pretty print check etc.
It seems it is not longer called "abandonware".

https://www.npmjs.com/package/grunt-jsonlint

Change 564075 merged by jenkins-bot:
[mediawiki/extensions/FileImporter@master] build: Replace jsonhint, update eslint, update wdio

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

I just want note that grunt-jsonlint has get a major release to version 2 and supports indent check and pretty print check etc.
It seems it is not longer called "abandonware".

https://www.npmjs.com/package/grunt-jsonlint

Oh well, about a year too late.

Jdforrester-WMF renamed this task from Stop using jsonlint (as it's abandonware) and instead use eslint-plugin-json for the linting to Stop using jsonlint and instead use eslint-plugin-json for the linting.Jan 13 2020, 7:21 PM

Change 564100 had a related patch set uploaded (by WMDE-Fisch; owner: WMDE-Fisch):
[mediawiki/extensions/FileExporter@master] build: Replace jsonlint with eslint

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

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

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

Change 564556 had a related patch set uploaded (by WMDE-Fisch; owner: WMDE-Fisch):
[mediawiki/extensions/Cognate@master] build: Replace jsonlint with eslint

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

Change 564556 merged by jenkins-bot:
[mediawiki/extensions/Cognate@master] build: Replace jsonlint with eslint

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

Change 564100 merged by jenkins-bot:
[mediawiki/extensions/FileExporter@master] build: Replace jsonlint with eslint

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

WMDE-Fisch updated the task description. (Show Details)Jan 15 2020, 9:51 AM
Majavah updated the task description. (Show Details)Jan 18 2020, 4:33 PM

Change 565737 had a related patch set uploaded (by Majavah; owner: Majavah):
[mediawiki/extensions/TrustedXFF@master] build: Use ESLint for JSON linting

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

Change 565737 merged by jenkins-bot:
[mediawiki/extensions/TrustedXFF@master] build: Use ESLint for JSON linting

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

Majavah updated the task description. (Show Details)Jan 19 2020, 8:30 AM
Majavah updated the task description. (Show Details)Jan 20 2020, 2:22 PM

Change 566040 had a related patch set uploaded (by Majavah; owner: Majavah):
[mediawiki/extensions/NewUserMessage@master] build: Use ESLint for JSON linting, pin ESLint versions

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

Change 566040 merged by jenkins-bot:
[mediawiki/extensions/NewUserMessage@master] build: Use ESLint for JSON linting, pin ESLint versions

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

Majavah updated the task description. (Show Details)Jan 20 2020, 5:11 PM
Majavah updated the task description. (Show Details)Jan 20 2020, 6:59 PM

Change 566084 had a related patch set uploaded (by Majavah; owner: Majavah):
[mediawiki/extensions/ShortUrl@master] build: Use ESLint instead of JSHint and JSONLint

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

Change 564136 merged by jenkins-bot:
[mediawiki/extensions/PageBlock@master] build: Replace jshint/jsonlint with eslint

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

Change 566294 had a related patch set uploaded (by Majavah; owner: Majavah):
[mediawiki/extensions/Insider@master] build: Use ESLint instead of JSHint and JSONLint

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

Jdforrester-WMF updated the task description. (Show Details)

Change 566084 merged by jenkins-bot:
[mediawiki/extensions/ShortUrl@master] build: Use ESLint instead of JSHint and JSONLint

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

Change 566294 merged by jenkins-bot:
[mediawiki/extensions/Insider@master] build: Use ESLint instead of JSHint and JSONLint

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

Change 563675 merged by jenkins-bot:
[mediawiki/extensions/PhpHighlight@master] build: Replace jshint/jsonlint with eslint

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

Change 563677 merged by jenkins-bot:
[mediawiki/extensions/PhpTags@master] build: Replace jshint/jsonlint with eslint

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

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

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

Change 566608 merged by jenkins-bot:
[mediawiki/extensions/HTMLTags@master] build: Replace jshint/jsonlint with eslint

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

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

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

Change 567248 merged by jenkins-bot:
[mediawiki/extensions/OnlineStatus@master] build: Replace jshint/jsonlint with eslint

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

Change 563679 merged by Umherirrender:
[mediawiki/extensions/PhpTagsStorage@master] build: Replace jshint/jsonlint with eslint

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

Change 560811 abandoned by Zoranzoki21:
New version 0.5.0

Reason:
Will make new

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

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

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

Change 570183 merged by jenkins-bot:
[mediawiki/extensions/EmailCapture@master] build: Replace jshint/jsonlint with eslint

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

Change 579852 had a related patch set uploaded (by Jforrester; owner: Zoranzoki21):
[mediawiki/skins/Nostalgia@master] build: Replace jsonlint with eslint

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

Change 579852 merged by jenkins-bot:
[mediawiki/skins/Nostalgia@master] build: Replace jsonlint with eslint

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

Change 579820 had a related patch set uploaded (by Jforrester; owner: Zoranzoki21):
[mediawiki/extensions/Capiunto@master] build: Replace jsonlint with eslint

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

Change 579820 merged by jenkins-bot:
[mediawiki/extensions/Capiunto@master] build: Replace jsonlint with eslint

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