SchwarzIT / onyx

🚀 A design system and Vue.js component library created by Schwarz IT
https://onyx.schwarz
Apache License 2.0
41 stars 4 forks source link

style: sort imports with prettier #1447

Open larsrickert opened 3 days ago

larsrickert commented 3 days ago

closes #519

changeset-bot[bot] commented 3 days ago

⚠️ No Changeset found

Latest commit: 9c5a32bccd98dd689cd4ed933d65afc7e40f3c6c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

larsrickert commented 3 days ago

Is there a benefit over using the default eslint rule https://eslint.org/docs/latest/rules/sort-imports ? The eslint rule also seems to work with .vue files

Yes because eslint use custom rules to sort the imports and you can not configure it to sort exactly like VSCode / Typescript language server which causes conflicts if you have enabled VS Code to also sort imports.

prettier-plugin-organize-imports uses theorganizeImports feature of the TypeScript language service API which is 1:1 what VS Code uses under the hood