Open Bug 1936120 Opened 2 months ago Updated 8 days ago

Enable eslint-plugin-lit

Categories

(Developer Infrastructure :: Lint and Formatting, task)

Tracking

(Not tracked)

People

(Reporter: mkennedy, Assigned: mkennedy)

References

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

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: