sveltejs / prettier-plugin-svelte

Format your svelte components using prettier.
MIT License
735 stars 95 forks source link

Disable Svelte attribute sorting #443

Open azat-io opened 3 months ago

azat-io commented 3 months ago

Hi, thanks for your plugin!

Could you please advise me how I can disable Svelte attribute sorting? It conflicts with the ESLint configuration.

I couldn't find any information about it in your documentation.

dummdidumm commented 3 months ago

Svelte does not sort attributes so I don't know what you mean exactly. Could you give a code example?

azat-io commented 3 months ago

I have created a project where the problem can be reproduced: npm run test

https://stackblitz.com/edit/stackblitz-starters-cjrzvy?description=HTML/CSS/JS%20Starter&file=.prettierrc,test.svelte,package.json&terminalHeight=10&title=Static%20Starter

dummdidumm commented 3 months ago

Ok so this is specific to the this attribute. It's a special one because it's separate from the attributes. Sorting it at the right place would be a bit hard. Which Eslint config does conflict with this sorting behavior? According to https://sveltejs.github.io/eslint-plugin-svelte/rules/sort-attributes/ the default is this at the top.