Page MenuHomePhabricator

[Query Builder] Use prettier instead of stylelint for stylistic rules like whitespace
Closed, DeclinedPublic8 Estimated Story Points

Description

In major version 15 of stylelint, the stylistic rules for things like indentation were deprecated. It is recommended to move to prettier for that. Stylelint will focus on semantic rules:

We've deprecated 76 of the rules that enforce stylistic conventions, e.g. indentation.

When we created these rules, pretty printers (like Prettier) didn't exist. They now offer a better way to consistently format code, especially whitespace. Linters and pretty printers are complementary tools that work together to help you write consistent and error-free code.

In order to cover for the deprecated rules, we should add the opinionated Prettier framework to do the format validation and reformatting.

Acceptance Criteria:

  • Prettier is added to enforce the deprecated stylelint rules
  • Any violations that could not be migrated are fixed

Notes:

Event Timeline

Task Review:

  • When this is picked up, we should consult the current mediawiki guidelines and compare between our options for this type of linting.

Prio Notes:

  • Does not affect end users / production
  • Does affect development efforts (the choice of tooling affects the warning we see in our day-to-day dev activities)
  • Does not affect onboarding efforts
  • Does not affect additional stakeholders
ItamarWMDE renamed this task from Use prettier instead of stylelint for stylistic rules like whitespace to [SW] [Query Builder] Use prettier instead of stylelint for stylistic rules like whitespace.Mar 28 2023, 1:50 PM
ItamarWMDE moved this task from [QT] By Project to [DOT] Prioritized on the wmde-wikidata-tech board.
ItamarWMDE added a project: Wikidata Dev Team.
ItamarWMDE moved this task from Incoming to [DOT] Tech Backlog on the Wikidata Dev Team board.

Story Writing Notes:

  • Clarify that this is not to fully replace stylelint, but to add support for deprecated features.
  • Add AC that prettier is configured to check that the code is as close to the WMF style guide as possible.
ItamarWMDE renamed this task from [SW] [Query Builder] Use prettier instead of stylelint for stylistic rules like whitespace to [Query Builder] Use prettier instead of stylelint for stylistic rules like whitespace.Sep 11 2023, 2:03 PM
ItamarWMDE updated the task description. (Show Details)
HasanAkgun_WMDE changed the task status from Open to Stalled.Sep 12 2023, 3:44 PM

After some time, it turned out that stylelint doesn't work at all and it finds more than 90 errors after making it work again. Changing the status to stalled until have a decision about whether using stylelint at all or not.

It's decided to go with stylelint-stylistic instead of prettier, therefore I'm closing this one.

The new ticket for stylelint-stylistic: T348449