Closed Bug 1921088 Opened 1 month ago Closed 20 days ago

Upgrade Stylelint to the latest version (^16.0.0)

Categories

(Developer Infrastructure :: Lint and Formatting, task)

Tracking

(firefox133 fixed)

RESOLVED FIXED
133 Branch
Tracking Status
firefox133 --- fixed

People

(Reporter: hjones, Assigned: hjones)

References

(Blocks 1 open bug)

Details

(Whiteboard: [recomp])

Attachments

(1 file)

Upgrading Stylelint will enable us to take advantage of ES Module support for plugins, amongst other things. Ideally the migration of custom plugins and other Stylelint code would be handled as part of this bug.

I was taking a stab at this and ran into one roadblock I could use some guidance on. It looks like in v15 Stylelint deprecated some Stylistic rules arguing those kinds of things are better handled by Prettier/formatters. Those rules have been completely removed in v16, but we're still using a handful of them for linting scss code. It looks like there's a community plugin we can install to keep using those rules, though if we want to use Prettier for formatting css/scss files down the road it would become redundant.

Given all that, would we prefer to

  • Install the stylelint-stylistic as part of this v16 upgrade;
  • Prioritize getting Prettier set up for css/scss files and wait on this upgrade so that the formatting rules are moot, or;
  • Stop enforcing those deprecated rules as part of the v16 upgrade knowing that if/when we start using Prettier for our stylesheets it will handle most of those issues

Happy to pursue any of the above options based on what y'all think is best.

Flags: needinfo?(standard8)
Flags: needinfo?(gijskruitbosch+bugs)

(In reply to Hanna Jones [:hjones] from comment #1)

I was taking a stab at this and ran into one roadblock I could use some guidance on. It looks like in v15 Stylelint deprecated some Stylistic rules arguing those kinds of things are better handled by Prettier/formatters. Those rules have been completely removed in v16, but we're still using a handful of them for linting scss code. It looks like there's a community plugin we can install to keep using those rules, though if we want to use Prettier for formatting css/scss files down the road it would become redundant.

Given all that, would we prefer to

  • Install the stylelint-stylistic as part of this v16 upgrade;

This one.

  • Prioritize getting Prettier set up for css/scss files and wait on this upgrade so that the formatting rules are moot, or;

Unfortunately our experience with prettier's formatting of multiline comments hasn't been very good, see e.g. https://bugzilla.mozilla.org/attachment.cgi?id=9271052&action=diff , search for: "On Mac, use the properties "

ISTR I filed a ticket about this at the time and had no meaningful response, cf. https://github.com/prettier/prettier/issues/12647 .

The wrapping of selectors that are currently single-line is also somewhat awkward, and there's no way to limit the wrapping to properties and not selectors. I think some of the desktop theme reviewers have some other objections as well.

Arguably we should wontfix bug 1606785...

Flags: needinfo?(gijskruitbosch+bugs)

In addition to upgrding our Stylelint packages, this patch also introduces the @stylistic/stylelint-plugin to preserve a number of rules that were completely removed in v16. It also migrates the code for the custom plugin introduced in bug 1838298 to ES Modules.

Assignee: nobody → hjones
Attachment #9428364 - Attachment description: WIP: Bug 1921088 - Upgrade Stylelint and related libraries to the latest version r=#frontend-codestyle-reviewers! → Bug 1921088 - Upgrade Stylelint and related libraries to the latest version r=#frontend-codestyle-reviewers!
Status: NEW → ASSIGNED
Flags: needinfo?(standard8)
Whiteboard: [recomp]
Pushed by hjones@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4861708c7796 Upgrade Stylelint and related libraries to the latest version r=Standard8,devtools-reviewers,omc-reviewers,home-newtab-reviewers,nchevobbe,thecount,desktop-theme-reviewers,dao,aminomancer
Status: ASSIGNED → RESOLVED
Closed: 20 days ago
Resolution: --- → FIXED
Target Milestone: --- → 133 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: