Closed Bug 1936120 Opened 1 year ago Closed 11 months ago

Enable eslint-plugin-lit

Categories

(Developer Infrastructure :: Lint and Formatting, task)

Tracking

(firefox137 fixed)

RESOLVED FIXED
137 Branch
Tracking Status
firefox137 --- fixed

People

(Reporter: mkennedy, Assigned: mkennedy)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [recomp])

Attachments

(2 files)

We've got some expectations around the styling of Lit syntax. So, to save some time from asking in every patch review, it would be worth enforcing certain style expectations when writing Lit elements. We can do this really easily with eslint-plugin-lit.

We already have ESLint installed on the project, so we'd only need to install/enable the package and add the rules we care about.

For example, one thing that comes up in patch reviews is to remove the surrounding quotes when declaring properties and attributes in Lit templates. Adding the quoted-expressions rule would ensure that this is done before any patch can be approved, without having a reviewer suggesting it in each review.

I think enabling extra rules for Lit is totally reasonable, though I'd defer to the reusable components team to suggest what rules are wanted.

There's details about adding new rules and plugins for ESLint here. I've already checked the licenses - they are all MIT, so we're alright there.

Whiteboard: [recomp]
Whiteboard: [recomp]
Whiteboard: [recomp]
Assignee: nobody → mkennedy
  • Installs eslint-plugin-lit

  • Adds configuration

Pushed by mkennedy@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a8fa80dbf630 Install eslint-plugin-lit and configuration r=Standard8,frontend-codestyle-reviewers https://hg.mozilla.org/integration/autoland/rev/37c22bbe5084 Enforce no quotes around Lit expressions r=reusable-components-reviewers,credential-management-reviewers,fxview-reviewers,omc-reviewers,backup-reviewers,sidebar-reviewers,frontend-codestyle-reviewers,profiles-reviewers,mtigley,mconley,hjones,jsudiaman,niklas,Standard8,pdahiya
Status: NEW → RESOLVED
Closed: 11 months ago
Resolution: --- → FIXED
Target Milestone: --- → 137 Branch
Blocks: 1851707
Blocks: 1949251
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: