Page MenuHomePhabricator

[ES-M3] EntitySchema: update linter configuration
Closed, ResolvedPublic

Description

As a developer working on the EntitySchema extension, I want to make sure the JS linting rules align with current common practices

Problem:
The EntitySchema linter config is a few years old and not up to date with common technologies/pratices

Example:
This change adds es6 support to the linter config.

Suggested improvements:

  • Make eslintrc.json an easier to work with, by making it a .js file
  • Require trailing commas in multiline arrays / objects

In general we want to take a look at more current projects to see what rules are used there (for example Special:NewLexeme linter config)

Acceptance Criteria

  • Linter configuration is up-to-date with current team standards

Event Timeline

noarave renamed this task from Update .eslinter.json to EntitySchema: update linter configuration.Mar 20 2023, 10:42 AM
ItamarWMDE renamed this task from EntitySchema: update linter configuration to [SW] EntitySchema: update linter configuration.Mar 28 2023, 1:15 PM
ItamarWMDE renamed this task from [SW] EntitySchema: update linter configuration to [SW] [ES-MS4] EntitySchema: update linter configuration.
ItamarWMDE renamed this task from [SW] [ES-MS4] EntitySchema: update linter configuration to [SW] [ES-MS3] EntitySchema: update linter configuration.
ItamarWMDE updated the task description. (Show Details)

Prio Notes:

  • Impact Areas: Analyzability
  • Does not affect end users / production
  • Does affect development efforts
  • Does not affect onboarding efforts
  • Does not affect additional stakeholders
ItamarWMDE renamed this task from [SW] [ES-MS3] EntitySchema: update linter configuration to [SW] [ES-M3] EntitySchema: update linter configuration.Mar 28 2023, 1:20 PM
ItamarWMDE added a project: Wikidata Dev Team.
ItamarWMDE renamed this task from [SW] [ES-M3] EntitySchema: update linter configuration to [ES-M3] EntitySchema: update linter configuration.Mar 29 2023, 1:10 PM
ItamarWMDE updated the task description. (Show Details)

Looking at T178356#8782595, it seems the current floor for Grade A support is E2018. That means that can in fact use async/await in our production code. This checks out when comparing the official Wikimedia list of "modern" browsers with the browser support for await.

Change 912303 had a related patch set uploaded (by Michael Große; author: Michael Große):

[mediawiki/extensions/EntitySchema@master] Update eslint to allow es2018 and require trailing commas

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

Change 912303 merged by jenkins-bot:

[mediawiki/extensions/EntitySchema@master] Update eslint to allow es2018 and require trailing commas

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