nhoizey’s avatarnhoizey’s Twitter Archive—№ 116,340

    1. …in reply to @mmatuzo
      @mmatuzo Looking forward to reading this post, as I started developing my first Web Component (vanilla) yesterday! codepen.io/nhoizey/pen/YzawBrq A question I would add: - should I define the WC like @zachleat does in github.com/zachleat/details-utils/blob/main/details-utils.js#L365-L367 ? - or let people import the lib and define the WC?
  1. …in reply to @nhoizey
    @mmatuzo @zachleat For example: github.com/thepassle/generic-components/blob/master/generic-switch/GenericSwitch.js exports the WC definition And the project has to import and define for the demo: github.com/thepassle/generic-components/blob/master/switch.js I don't know which way is the best. Maybe a mix of both.
    1. …in reply to @nhoizey
      @mmatuzo @zachleat I think I've found the answer in this rule for the custom elements plugin for aslant: github.com/github/eslint-plugin-custom-elements/blob/main/docs/rules/define-tag-after-class-definition.md
      1. …in reply to @nhoizey
        @mmatuzo @zachleat Sooo… "aslant" was "eslint"… 😅 #damnyouautocorrect