sveltejs / prettier-plugin-svelte

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

tabWidth: 4 for <script>, 2 for markup/<style> #416

Open mustafa0x opened 5 months ago

mustafa0x commented 5 months ago

In .svelte files, is it possible to indent js with 4 spaces, but set 2 spaces for markup and css?

const config = {
    overrides: [
        {
            files: '*.js',
            options: {
                tabWidth: 4,
            },
        },
        {
            files: ['*.html', '*.css'],
            options: {
                tabWidth: 2,
            },
        },
        {
            files: '*.svelte',
            options: {
                tabWidth: 4,
            },
        },
    ],
}