conversionxl / aybolit

Lightweight web components library built with LitElement.
https://conversionxl.github.io/aybolit/
MIT License
7 stars 8 forks source link

organize imports #190

Closed anoblet closed 1 year ago

anoblet commented 2 years ago

This adds prettier-plugin-organize-imports (https://github.com/simonhaenisch/prettier-plugin-organize-imports) which handles sorting of imports automatically.

anoblet commented 2 years ago

I'm not sure if prettier should be manually run on cxl-lumo-styles, cxl-ui, and storybook separately to only pick up the import organization or if it's better to run on packages in it's entirety to get everything up to speed.

anoblet commented 2 years ago

I switched to eslint-plugin-simple-import-sort, omitted the code block in packages/cxl-ui/index.js from being sorted and ran eslint only on cxl-ui and storybook for a cleaner PR.

github-actions[bot] commented 2 years ago

size-limit report 📦

Path Size
packages/cxl-ui/pkg/dist-web/cxl-ui-playbooks.js, packages/cxl-ui/pkg/dist-web/cxl-ui.js 41.47 KB (+0.23% 🔺)
anoblet commented 2 years ago

Updated for the playbooks base branch.

lkraav commented 2 years ago

Hmmm, this PR might have to be done separately for both branches.

As in master alone, first, then playbooks for what's left over. For safety.

anoblet commented 2 years ago

I could get rid of the actual eslint run in this PR and open up separate PRs for master and playbooks that run eslint on the entire packages folder?

lkraav commented 2 years ago

I could get rid of the actual eslint run in this PR and open up separate PRs for master and playbooks that run eslint on the entire packages folder?

It already runs on commit

https://github.com/conversionxl/aybolit/blob/master/package.json#L18

I thought everything ESLinted by now, but if it does find differences, yes, we could PR that.

anoblet commented 2 years ago

Running eslint on the packages folder triggers prettier to clean up some left over stuff. I created a separate PR for master (https://github.com/conversionxl/aybolit/pull/192) which includes a separate prettier commit.

I'll add the prettier commit to this PR giving us one PR for each branch (master/playbooks).

pawelkmpt commented 1 year ago

Not clear if useful as not merged for 1,5 year.

anoblet commented 1 year ago

This would be nice to have at some point as it standardizes the order in which we define imports. I have a habit of pressing Alt + Shift + O so that imports are sorted alphabetically.